3 unstable releases
0.2.1 | Aug 8, 2020 |
---|---|
0.2.0 | May 21, 2020 |
0.1.0 | Apr 19, 2020 |
#2371 in Data structures
37KB
800 lines
This crate provides ArrayStump
, a data structure mixing dynamic array and sorted set semantics.
For algorithmic notes see: README on GitHub
Example
use array_stump::ArrayStump;
fn comparator(a: &i32, b: &i32) -> std::cmp::Ordering {
a.cmp(b)
}
let mut array_stump = ArrayStump::new(comparator);
array_stump.insert(2);
array_stump.insert(3);
array_stump.insert(1);
array_stump.remove(&2);
assert_eq!(array_stump.collect(), vec![1, 3]);