Skip to content

gabi-250/rust-avl-tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest version Documentation

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

About

An AVL tree implementation in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages