This repository contains generic d-ary heap (d-heap) priority queue implementations with O(1) lookup for item updates and configurable arity d.
- Min-heap or max-heap behavior via comparator
- Efficient operations: O(1) front, O(log_d n) insert/update, O(d · log_d n) pop
- Examples and unit tests included in each language subproject
- Both implementations provide the exact same set of operations (API parity between C++ and Rust).
- Provided: access top (front), insert, update priority of existing item, delete-top (pop), size/length, emptiness check.
- Not provided: erase/remove arbitrary item by identity, meld/merge of heaps, stable ordering for equal priorities, or iterators supporting removal during traversal.
Explore the language-specific implementations:
Language | README |
---|---|
Cpp/README.md | |
Rust/README.md |
References:
- Ahuja, Magnanti & Orlin, Network Flows (1993), Section A.3 on d-Heaps