Template Function ADS::heapSampling

Function Documentation

template<class T, class R>
std::vector<T> ADS::heapSampling(const std::vector<T> &S, std::size_t n, R &g)

n items of the stream S, in the order of S, by the n largest of random keys, as if the length of S were unknown

Pre:

n <= the size of S