How To Implement Binary Search Tree In Javascript - letsbug
Many times we required to have more than two paths from data object (non-linear) when we have to represent one or many relationship. The best way is to use non-linear data structure. Tree is a non-linear data structure. Non-linear data structures are capable of expression more complex relationship than linear data structure. In general, wherever the hierarchical relationship among data is to be preserved tree is used. Today in this article we are going to implement a basic Binary Search Tree . But before that lets see a binary tree. What is a Binary Tree? Binary Tree is a special form of a tree is finite set of nodes, which is either empty or partitioned into three sets, one which is the root and two disjoint binary trees called left subtree and right subtree. It si a tree where every node can have at most two bran