Template Function eastl::promote_heap(RandomAccessIterator, Distance, Distance, const T&)

Function Documentation

template<typename RandomAccessIterator, typename Distance, typename T>
void eastl::promote_heap(RandomAccessIterator first, Distance topPosition, Distance position, const T &value)

promote_heap

Moves a value in the heap from a given position upward until it is sorted correctly. It’s kind of like bubble-sort, except that instead of moving linearly from the back of a list to the front, it moves from the bottom of the tree up the branches towards the top. But otherwise is just like bubble-sort.

This function requires that the value argument refer to a value that is currently not within the heap.