Why it matters
MoM enables worst-case linear selection. Understanding shapes selection theory.
Advertisement
The architecture
Group into 5s.
Median of each group.
Recursively find median of medians.
Use as pivot.
Advertisement
How it works end to end
Groups of 5 give 30/70 pivot guarantee.
T(n) = T(n/5) + T(7n/10) + O(n) = O(n).
Theoretical importance.