-
Anish Moorthy authored
The previous implementation of alexandria:median sorted the entire sequence and chose/averaged the relevant elements, yielding an O(n log n) runtime. This commit implements a linear-time algorithm as a special case of the quick-select algorithm (https://en.wikipedia.org/wiki/Quickselect).
46d8b0ad