Overview
Median of Medians groups values, finds medians of those groups, and recursively chooses a robust pivot for selection.
Selects a pivot that guarantees linear-time selection in the worst case.
Compact metadata for implementation and discovery.
Median of Medians groups values, finds medians of those groups, and recursively chooses a robust pivot for selection.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n)
Worst
O(n)
Space
O(log n)
T(n) <= T(n/5) + T(7n/10) + O(n)Captures why the deterministic pivot still gives linear worst-case selection.
Show groups producing medians, then a pivot that discards a guaranteed fraction of values.
The method is important for guarantees, though randomized Quickselect is often faster in practice.
What each reference supports for this entry.
Original deterministic linear-time selection paper using median-of-medians pivots.
Open sourceAlgorithms textbook support for Median of Medians's invariant, correctness argument, and asymptotic analysis.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Median of medians can choose deterministic pivots for worst-case linear-time selection.