partial_sort function template — Sorts the first part of a range
template<typename RandIter> void partial_sort(RandIter first, RandIter middle, RandIter last); template<typename RandIter, typename Compare> void partial_sort(RandIter first, RandIter middle, RandIter last, Compare comp);
The partial_sort
function
template sorts the initial middle
- first
elements of the range
[first
, last
) into the range [first
, middle
). The remaining elements at
[middle
, last
) are not in any particular
order.
The first form compares values using the <
operator. The second form calls
comp(*iter1
, *iter2)
.
See Figure 13-11 for an illustration of the partial-sort algorithm.