cppreference.com > C++ Algorithms > partial_sort
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.