avltree 0.1.0

A very simple AVL tree implementation
Documentation
  • Coverage
  • 63.64%
    7 out of 11 items documented5 out of 9 items with examples
  • Size
  • Source code size: 62.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.18 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • gabi-250

avl-tree-rust

An AVL tree implementation in Rust.

The current implementation stores the nodes in a vec inside the SearchTree struct. The parent of a node and its children are referenced using their index in the vec.

Supported operations:

  • insert
  • lookup

Example

Returning an iterator over the values in the tree:

extern crate avltree;

use avltree::SearchTree;

fn main() {
   let mut tree: SearchTree<u64> = SearchTree::new();
   tree.insert(5);
   tree.insert(2);
   tree.insert(1);
   assert!(tree.iter().zip(vec![1, 2, 5]).all(|(x, y)| *x == y));
}