In computer science, a binary search tree (BST), sometimes also called an ordered or sorted binary tree, is a node-based binary tree data structure which has the following properties:
1.The left subtreeof a node contains only nodes with keys less than the node's key.
2.The right subtreeof a node contains only nodes with keys greater than the node's key.
3.The left and right subtreesmust each also be a binary search tree.
4.There must be no duplicate nodes.