#sorting #array #structure #mixing #semantics #set #dynamic

array_stump

A data structure mixing dynamic array and sorted set semantics

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

MIT license

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]);

No runtime deps