In computer science, a binary search tree (BST) is a binary tree data structure which has the following properties:
* each node has a value;
* a total order is defined on these values;
* the left subtree of a node contains only values less than the node's value;
* the right subtree of a node contains only values greater than or equal to the node's value.
The major advantage of binary search trees is that the related sorting algorithms and search algorithms such as in-order traversal can be very efficient.