Template Function ADS::partition(std::vector<T>&, std::size_t, std::size_t, C)

Function Documentation

template<class T, class C = std::less<>>
std::size_t ADS::partition(std::vector<T> &A, std::size_t start, std::size_t end, C less = C())

perno(): the pivot A[ start ] goes to its place j, the smaller items before it, the others after it; end - start comparisons

Pre:

start <= end < n

Post:

A[ start .. j - 1 ] < A[ j ] <= A[ j + 1 .. end ]