partial_sort_copy. McGraw-Hill The Complete Reference Fourth Edition
જાહેરાત
જાહેરાત
850
C + + : T h e C o m p l e t e R e f e r e n c e
The partial_sort( ) algorithm sorts the range start to end. However, after execution, only elements in the range start to mid will be in sorted order.
The second form allows you to specify a comparison function that determines when one element is less than another.
partial_sort_copy
template <class InIter, class RandIter>
RandIter partial_sort_copy(InIter start, InIter end,
RandIter res_start, RandIter res_end); template <class InIter, class RandIter, class Comp>
RandIter partial_sort_copy(InIter start, InIter end,
RandIter res_start, RandIter res_end,
Comp cmpfn);
The partial_sort_copy( ) algorithm sorts the range start to end and then copies as many elements as will fit into the resulting sequence defined by res_start and res_end. It returns an iterator to one past the last element copied into the resulting sequence.
The second form allows you to specify a comparison function that determines when one element is less than another.
partition
template <class BiIter, class UnPred>
BiIter partition(BiIter start, BiIter end, UnPred pfn);
The partition( ) algorithm arranges the sequence defined by start and end such that all elements for which the predicate specified by pfn returns true come before those for which the predicate returns false. It returns an iterator to the beginning of the elements for which the predicate is false.
pop_heap
template <class RandIter> void pop_heap(RandIter start, RandIter end); template <class RandIter, class Comp> void pop_heap(RandIter start, RandIter end, Comp cmpfn);
The pop_heap( ) algorithm exchanges the first and last
−1 elements and then rebuilds the heap.
ડાઉનલોડ કરો
જાહેરાત