Sorting algorithms and sorting-based problem solving.
- Comparison sorts (bubble, selection, insertion)
- Efficient sorts (merge sort, quick sort)
- Non-comparison sorts (counting, radix, bucket)
- Stability in sorting
- Custom comparators
- Sorting applications
- When to sort vs when not to
- Use std::sort for O(n log n) sorting
- Understand when sorting helps (often simplifies to O(n))
- Master merge sort for divide-and-conquer understanding
- Quick sort is fastest in practice (average case)
- Custom comparators: sort(v.begin(), v.end(), comparator)
- Consider if sorting changes the problem constraints