6 releases
0.1.5 | Apr 26, 2023 |
---|---|
0.1.4 | Apr 18, 2023 |
#1606 in Data structures
57 downloads per month
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);