Standard C++ Library Class Reference

Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
nth_element
Algorithm
Summary
Rearranges a collection so that all elements lower in sorted order than the nth element come
before it and all elements higher in sorter order than the nth element come after it.
Contents
Synopsis
Description
Complexity
Example
Warning
See Also
Synopsis
#include <algorithm>
template <class RandomAccessIterator>
void nth_element (RandomAccessIterator first,
RandomAccessIterator nth,
RandomAccessIterator last);
template <class RandomAccessIterator, class Compare>
void nth_element (RandomAccessIterator first,
RandomAccessIterator nth,
RandomAccessIterator last,
Compare comp);