Selection algorithm (source code)

= Selection algorithm

= Selection
{synonym}

Find one specified <order statistic> without sorting every element. Partitioning about a pivot retains only the side containing the requested rank. <Median of medians> guarantees a balanced enough pivot to give worst-case linear <time complexity>.