## Given a “black box” O(n) median algorithm, what can we do?

- ith order statistic:
- Find median x
- Partition input around x
- if (i ? (n+1)/2) recursively find ith element of first half
- else find (i - (n+1)/2)th element in second half
- T(n) = T(n/2) + O(n) = O(n)

- Can you think of an application to sorting?

- ith order statistic:

Previous slide | Next slide | Back to first slide | View graphic version |