Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Sorting

Sorting algorithms and sorting-based problem solving.

Key Concepts Covered

  • 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

Tips

  • 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