6 releases

0.1.5 Apr 26, 2023
0.1.4 Apr 18, 2023

#1606 in Data structures

Download history 1/week @ 2024-03-29 1/week @ 2024-04-05

57 downloads per month

GPL-3.0 license

20KB
397 lines

avl-cont

A contiguous AVL Tree. Written by Toni Jarjour.

let mut tree = binary_search::Tree::default();

// Insert values.
for n in 0..1000 {
    tree.insert(n);
}

// Remove a value.
assert_eq!(tree.remove(511).unwrap(), 511);
assert_eq!(tree.contains(511), None);

// Check if a value is in the tree, returns its index.
let value_index = tree.contains(732).unwrap();

// Get a reference to the value.
assert_eq!(tree.get(value_index).unwrap(), &732);

No runtime deps