What kind of pivot do we want to pick?
- Max or min? No, then we get selection sort because one list will
have n-1 elements and the other .
- First element in list? Not good if list sorted or reverse sorted
(get max or min)!
- Median of list? That would be perfect... T(n) = n + 2 T(n/2).
Hard to find quickly. (Can be done in linear time, however.)
- Random element in list? Good chance of breaking the list into
substantial chunks. Fast. But random... more complex analysis.
(Next time.)
- Median of 3 randoms? More work, but more stable.
Next: Empirical Comparison
Up: DIVIDE-AND-CONQUER SORTING
Previous: Explanation