4 ms·
Tangential observation: most implementations of quickselect to find the median I've seen use 6N comparisons in the average case; for an even length list they se
by ajanuary 13y ago
Tangential observation: most implementations of quickselect to find the median I've seen use 6N comparisons in the average case; for an even length list they select the middle values using two independent quickselects. The code to do it in a single quickselect gets hairy quite quickly.