Binary search trees are a type of binary trees that takes ordering into account.
BSTs are used to store data items which may be inserted, deleted, or retrieved in constant time. In addition, the BST property ensures that the tree is balanced) and that the height of the tree is logarithmic in the number of nodes in it.
They are an example of a self-balancing binary tree: every node in a binary search tree has at most two children, with every child having a value less than its parent. This allows us to perform lookups and insertions by searching through the tree from top to bottom until we find our target node, which has no more than two children itself; at this point we have found our target or there is no such node in our tree.
Because of these attributes, they make for popular interview problems!
How do I use this section?