#interval #tree #discrete #encoding

diet

A Discrete Interval Encoding Tree implementation

1 unstable release

Uses old Rust 2015

0.1.0 Jul 26, 2015

#1390 in Math

18KB
353 lines

rust-diet

An implementation of Discrete Interval Encoding Trees in Rust. Currently only supports i32.

Install

Add diet as a dependency to your Cargo.toml.

[dependencies]
diet = { version = "0.0.1", hg = "ssh://hg@bitbucket.org/nikhilm/rust-diet"
}

Usage

Create a Diet:

let mut diet = Diet::new();

Insert elements:

diet.insert(5);
diet.insert(10);

Query elements:

assert!(diet.contains(5));
assert!(!diet.contains(7));

Delete elements:

diet.delete(6);
diet.delete(5);
assert!(!diet.contains(5));
assert!(diet.contains(10));

No runtime deps