Binary Search Trees
A Binary Search Tree (BST) is a data structure that organizes data in a hierarchical manner. Each node in a BST contains a value, and it has two children: a left child and a right child. The left child contains values less than the parent node, while the right child contains values greater than the parent node. This arrangement allows for efficient searching, insertion, and deletion of values.
BSTs are commonly used in computer science for tasks that require quick data retrieval. The average time complexity for operations like search, insert, and delete in a balanced BST is O(log n), making it a preferred choice for many applications involving sorted data.