1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
hi(nth_element)
itemization(
it() Header file: tt(<algorithm>)
it() Function prototypes:
itemization(
itt(void nth_element(RandomAccessIterator first,
RandomAccessIterator nth, RandomAccessIterator last);)
itt(void nth_element(RandomAccessIterator first,
RandomAccessIterator nth, RandomAccessIterator last, Compare
comp);)
)
it() Description:
itemization(
it() The first prototype: all elements in the range rangett(first,
last) are sorted relative to the element pointed to by tt(nth): all elements
in the range rangett(left, nth) are smaller than the element pointed to by
tt(nth), and alle elements in the range rangett(nth + 1, last) are greater
than the element pointed to by tt(nth). The two subsets themselves are not
sorted. The tt(operator<) of the data type to which the iterators point is
used to compare the elements.
it() The second prototype: all elements in the range rangett(first,
last) are sorted relative to the element pointed to by tt(nth): all elements
in the range rangett(left, nth) are smaller than the element pointed to by
tt(nth), and alle elements in the range rangett(nth + 1, last) are greater
than the element pointed to by tt(nth). The two subsets themselves are not
sorted. The tt(comp) function object is used to compare the elements.
)
it() Example:
verbinclude(-a examples/nthelement.cc)
)
|