Forum discussion on Binary Search Tree

Binary tree

Binary tree

by Saim Jaman -
Number of replies: 0

A Binary Search Tree (BST) is a tree in which all the nodes follow the below-mentioned properties −


The value of the key of the left sub-tree is less than the value of its parent (root) node's key.


The value of the key of the right sub-tree is greater than or equal to the value of its parent (root) node's key.


Thus, BST divides all its sub-trees into two segments; the left sub-tree and the right sub-tree and can be defined as −


left_subtree (keys) < node (key) ≤ right_subtree (keys)