Template Function eastl::push_heap(RandomAccessIterator, RandomAccessIterator)

Function Documentation

template<typename RandomAccessIterator>
void eastl::push_heap(RandomAccessIterator first, RandomAccessIterator last)


Adds an item to a heap (which is an array). The item necessarily comes from the back of the heap (array). Thus, the insertion of a new item in a heap is a two step process: push_back and push_heap.

Example usage: vector<int> heap;

heap.push_back(3); push_heap(heap.begin(), heap.end()); // Places ‘3’ appropriately.