template<class Key, class Val>
class clustering::BinaryHeap< Key, Val >
Binary min-heap of (key, val) pairs ordered on key.
Plain d=2 heap backed by a single std::vector. push, top, pop are the full surface; no bulk-build, no merge, no handles. Use IndexedHeap when a stable handle and decreaseKey are needed.
- Template Parameters
-
| Key | Orderable key type; operator< defines the ordering. Smaller keys pop first. |
| Val | Payload carried alongside the key. |
Definition at line 25 of file heap.h.
template<class Key, class Val>
Remove the smallest-key entry.
Swaps the root with the tail, pops the tail, then sifts the new root down. O(log n). Asserts on an empty heap.
Definition at line 60 of file heap.h.