2 releases

0.1.1 Oct 24, 2019
0.1.0 Oct 16, 2019

#2551 in Algorithms

MIT license

8KB
195 lines

Red-Black Binary Search Tree

How to use

use redblackbst;
fn how_use() {
    let mut bst = redblackbst::RedBlackBST::new();
    bst.put(3, "1");
    bst.put(2, "2");
    bst.put(1, "3");
    assert_eq!(bst.size(), 3);
    assert_eq!(bst.get(1), Some(&"3"));
    assert_eq!(bst.get(4), None);
}

Functions added in version 0.1.1

  1. height
  2. is_empty
  3. min
  4. max

No runtime deps