← Selection Sort | Quick Sort | Merge Sort →
Exit Slides

Summary

quick_sort sorts by selecting a pivot, partitioning into less and greater subarrays, then recursing. It is a divide_and_conquer, usually in_place, unstable_sort. Average time is O(n_log_n); worst case is O(n_squared). Common partition schemes are lomuto and hoare. Typical pivot choices include median_of_three and random_pivot. Uses recursion with small extra space and shows good cache_locality on arrays. Worst case often occurs on sorted or reverse_sorted input with naive pivots.
Slide 1 / 2