In Chapter 3, The Iterator-Pair Algorithms, we introduced the family of "heap" algorithms: make_heap, push_heap, and pop_heap. You can use these algorithms to give a range of elements the max-heap property. If you maintain the max-heap property on your data as an invariant, you get a data structure commonly known as a priority queue. In data-structure textbooks, a priority queue is often depicted as a kind of binary tree, but as we saw in Chapter 3, The Iterator-Pair Algorithms, there's nothing about the max-heap property that requires an explicitly pointer-based tree structure.
The standard container std::priority_queue<T, Ctr, Cmp> represents a priority queue, represented internally as an instance of Ctr where the elements of the Ctr are invariably in max-heap order (as determined by an instance of the comparator...