stl:algorithm:partial_sort

C++ Reference

partial_sort

Syntax:

    #include <algorithm>
    void partial_sort( iterator start, iterator middle, iterator end );
    void partial_sort( iterator start, iterator middle, iterator end, StrictWeakOrdering cmp );

The partial_sort() function arranges the first N elements of the range [start,end) in ascending order. N is defined as the number of elements between start and middle.

By default, the < operator is used to compare two elements. If the strict weak ordering comparison function cmp is given, it is used instead.

Related Topics: binary_search, is_sorted, nth_element, partial_sort_copy, sort, stable_sort