3 ms·
The title is wrong - this algorithm (as the article explains) finds a value near the median, not the actual median. This value is useful as a qucksort pivot bu
by kens 16y ago
The title is wrong - this algorithm (as the article explains) finds a value near the median, not the actual median. This value is useful as a qucksort pivot but is not the median. Edit: oops, I'm wrong. I missed the recursion step that uses this to get the median.
The median of medians is not necessarily the median. E.g. take 1 2 5, 3 4 6, 7 8 9: medians are 2, 4, 8. Median of medians is 4 but overall median is 5.
- dhruvbird 16y agoActually, the median of the medians is used to find the real median