Binary Search Tree
JavaScript implementation of Binary Search Tree.
Installation & Usage :
npm install binary_search_tree_ds
const BinarySearchTree = require('binary_search_tree_ds'); let bst = new BinarySearchTree(); bst.insert(1); // Insert an element to bst treebst.find(1); // If node exits with the given value it returns that node otherwise undefinedbst.contains(1); // If node exits with the given value it returns true otherwise falsebst.bfs() // Returns array of values in breadth first search orderbst.dfs() // Returns array of values in depth first search orderbst.dfsPreOrder() // Returns array of values in pre depth first search orderbst.dfsPostOrder() // Returns array of values in post depth first search order