push_heap [C++ Reference]
Keywords: stl,algorithm,push_heap
Date: 2009-10-09T02:08:01-0700

[[push_heap]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## push_heap

Syntax:

        #include <algorithm>
        void push_heap( random_iterator start, random_iterator end );
        void push_heap( random_iterator start, random_iterator end, StrictWeakOrdering cmp );

The push_heap() function adds an element (defined as the last element before end) to a heap (defined as the range of elements between [start,''end-1).

If the strict weak ordering comparison function object cmp is given, then it is used instead of the < operator to compare elements.

push_heap() runs in logarithmic time.

Related Topics: is_heap, make_heap, pop_heap, sort_heap

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •