Image for binary search tree

binary search tree

A binary search tree (BST) is a data structure used in computer science to organize information for efficient searching, adding, and deleting. In a BST, each piece of data, called a node, has up to two child nodes: one on the left and one on the right. The left child contains values smaller than the parent, while the right child has values larger. This structure allows for quick lookups, as each comparison halves the search space, making finding a value faster than in a simple list. BSTs are foundational in algorithms for databases and other applications requiring sorted data.