ds-bst

Crates.iods-bst
lib.rsds-bst
version0.3.0
sourcesrc
created_at2021-04-26 15:22:14.695364
updated_at2022-03-15 20:56:56.986034
descriptionBinary search tree implementation
homepage
repositoryhttps://github.com/iapain/rust-bst
max_upload_size
id389746
size11,849
Deepak (iapain)

documentation

https://docs.rs/ds-bst

README

Binary Search Tree

Implements a Binary Search Tree in Rust. This is a recursive data structure and left and right refers to sub trees.

Installation

In your cargo dependencies add following

ds-bst = "*"
use ds_bst::BinarySearchTree;

let mut node = BinarySearchTree:new(5);
node.insert(1);
node.insert(2);
node.insert(10);
// or

let mut root = BinarySearchTree::from(vec![1,2,3,4,5,6,7,8,9]);
root.insert(10);
let ordered: Vec<_> = root.inorder();
let min = root.find_min();
let max = root.find_max();
Commit count: 21

cargo fmt