partial_sort [C++ Reference]
Keywords: stl,algorithm,partial_sort
Date: 2009-10-09T01:46:21-0700

[[partial_sort]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## partial_sort

Syntax:

        #include <algorithm>
        void partial_sort( random_iterator start, random_iterator middle, random_iterator end );
        void partial_sort( random_iterator start, random_iterator middle, random_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

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •