Template Function ADS::medianOfMedians

Function Documentation

template<class T>
T ADS::medianOfMedians(std::vector<T> &A, std::size_t k)

the item of rank k, 1 <= k <= n, in linear time in the worst case

Pre:

1 <= k <= n

Post:

the result has rank k in A