std::sort_heap
cppreference.com
[] |
Google. . , . , . |
<metanoindex/>
<tbody> </tbody> template< class RandomIt > void sort_heap( RandomIt first, RandomIt last ); |
(1) | |
template< class RandomIt, class Compare > void sort_heap( RandomIt first, RandomIt last, Compare comp ); |
(2) | |
[first, last) . operator< , comp.:
Sorts the elements in the heap
[first, last) in ascending order. The first version of the function uses operator< to compare the elements, the second uses the given comparison function comp.| first, last | ||
| comp | (.. , Compare), true, "", .:
| |
-RandomIt ValueSwappable RandomAccessIterator.
| ||
-The type of dereferenced RandomIt must meet the requirements of MoveAssignable and MoveConstructible.
| ||
()
N (N) ,
N=std::distance(first, last).'
[f,l), :*fstd::push_heap()std::pop_heap()
, .
| : |
.
| ( ) |