Daily bit(e) of C++ | std::make_heap, std::push_heap, std::pop_heap, std::sort_heap
Daily bit(e) of C++ ♻️52, An alternative to std::priority_queue and std::set, the heap algorithms: std::make_heap, std::push_heap, std::pop_heap and std::sort_heap.
The set of heap algorithms: std::make_heap, std::push_heap, std::pop_heap and std::sort_heap can be used as a replacement for std::priority_queue and std::set when it is desirable to keep the elements in a contiguous storage or when we require cheap element extraction.
For the benefits, we pay with a more error-prone interface.