### Re-implement median function using the quick-select algorithm

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).

Showing

Please register or sign in to comment