Linear-Time Median Selection
Worst-case O(n lg n) quicksort
Find median x and partition around it
Recursively quicksort two halves
T(n) = 2T(n/2) + O(n) = O(n lg n)
Previous slide
Back to first slide
View graphic version