Binary Search Tree written in Javascript.
Script.js file tests some of the functions of the tree.
To use all functions, use binarySearchTree.js file.
It has functions like:
insert(value)- inserts node with the given value in the treedelete(value)- deletes node with the given value from the treefind(value)- returns the node of the given value from the tree if foundlevelOrder()- traverses each node of the tree in level orderinOrder()- traverses each node of the tree inorder (left tree/subtree, root node, right tree/subtree)preOrder()- traverses each node of the tree in preorder (root node, left tree/subtree, right tree/subtree)postOrder()- traverses each node of the tree in postorder (left tree/subtree, right tree/subtree, root node)height()- returns the height of the tree (longest path between root node and leaf node)depth()- returns the depth of the tree (distance between node and the root)isBalanced()- returns true if the tree is balanced otherwise falsereBalance()- balances the tree if the tree is not balanced