What do you mean by Binary Search Tree?

  • A binary search tree (BST) is a variant of binary tree data structure that stores data in a very efficient manner such that the values of the nodes in the left sub-tree are less than the value of the root node, and the values of the nodes on the right of the root node are correspondingly higher than the root.
  • Also, individually the left and right sub-trees are their own binary search trees at all instances of time.

Binary Search Tree is a binary tree in which left subtree of every node contains smaller values and right subtree contains larger values. i.e., All the nodes on the left of root node have values lesser than root node and all the nodes on the right of root node have values greater than root node.

No two nodes can have the same value stored in them.

Here a value stored in a node is also called as key.

Operations on BST
Find, Insert, Delete