Crates.io | binary-heap-plus |
lib.rs | binary-heap-plus |
version | 0.5.0 |
source | src |
created_at | 2018-05-14 09:19:13.297147 |
updated_at | 2022-09-30 08:50:59.690041 |
description | Enhanced version of std::collections::BinaryHeap that supports max, min, and custom-order heaps. |
homepage | |
repository | https://github.com/sekineh/binary-heap-plus-rs |
max_upload_size | |
id | 65310 |
size | 88,686 |
Enhancement over Rust's
std::collections::BinaryHeap
.
It supports the following heaps and still maintains backward compatibility.
BinaryHeap::new()
or ::with_capacity()
BinaryHeap::new_min()
or ::with_capacity_min()
BinaryHeap::new_by()
or ::with_capacity_by()
BinaryHeap::new_by_key()
or ::with_capacity_by_key()
Other notable added methods are:
BinaryHeap::from_vec_cmp()
and BinaryHeap::from_vec()
for more generic construction..into_iter_sorted()
which is less-surprising version of .into_iter()
. The implementation is backported from std
..replace_cmp()
which replace the comparator of the existing heap.This crate is based on the standard library's implementation of
BinaryHeap
from Rust 1.62.0.
The minimum supported Rust version is 1.56.0.
See CHANGELOG.md.
serde1
.unsafe
perf optimization.See the following discussions for the background of the crate: