Beginners
- Look at the
OrderedVectorcode - Compile and run
playwithsort.cpp. See the ordering - Modify
playwithsort.cppand reuseOrderedVectorwithComplex
Intermediary
- Extend
OrderedVectorto allow to customize the ordering via an additional template parameter. This template parameter should be a comparison object that defaults tostd::less. Hint: You have to customize the loop in OrderedVector::add where the insertion point is defined. - Try ordering by reversed strings (from the last letter, don't change the strings!)
- Test order based on Manhattan distance with complex type
Bonus
- Check the implementation of
Complex - Try ordering complex of complex