I recently received several PRs for binary-heap-plus and published v0.3.1 and v0.4.0 of the crate.
- https://crates.io/crates/binary-heap-plus
- binary_heap_plus - Rust
- https://github.com/sekineh/binary-heap-plus-rs
For most of people who don't know the crate, it's a folk of std::collections::BinaryHeap and adds extra features including:
- Various heaps (max, min, sorted by closure, sorted by key, etc.)
- Specific constructors:
new(),new_min(),new_by(),new_by_key() - Generic consrtructor:
from_vec_cmp()
- Specific constructors:
-
into_iter_sorted()which returns values in right order.- If you ever surprised when you find
into_iter()return values in arbitrary order, it's a feature for you!
- If you ever surprised when you find
-
replace_cmp()(and itsunsafecousin) which replaces comparator of the existing binary heap in place!
... and still maintains backward compatibility.
Hope it helps your project.