Template Function ADS::selection

Function Documentation

template<class T, class R = std::mt19937>
T ADS::selection(std::vector<T> &A, std::size_t k, R *rng = nullptr)

selezione(): the item of rank k, 1 <= k <= n, of A; with a generator the pivots are random, otherwise the first item of the part

Pre:

1 <= k <= n

Post:

the result has rank k in A