array_stump 0.2.1

A data structure mixing dynamic array and sorted set semantics.
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 1 items with examples
  • Size
  • Source code size: 42.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.05 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • bluenote10

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