C++ Coding Reference: Partial Sorting with nth_element from Algorithm header
nth_element is a partial sorting algorithm which can be invoked by including the header algorithm. It has following two forms: void nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last); void nth_element(_RanIt …