Overview
A Binary Search Tree supports search, insertion, and deletion by comparing the target key at each node and descending left or right according to the ordering invariant.
Stores ordered keys in a tree where left descendants are smaller and right descendants are larger.
Compact metadata for implementation and discovery.
A Binary Search Tree supports search, insertion, and deletion by comparing the target key at each node and descending left or right according to the ordering invariant.
Quick facts
Runtime and memory behavior at a glance.
Best
O(log n)
Average
O(log n)
Worst
O(n)
Space
O(n)
Show comparisons guiding a search down left and right branches.
The basic BST is a foundation for balanced trees such as AVL and red-black trees.
What each reference supports for this entry.
Textbook reference for the algorithmic family and analysis of Binary Search Tree.
Good next jumps from the relationship graph, ranked for useful discovery.
Data Structures · Extended
Splay Tree is a data-structure variant of Binary Search Tree with different update or query tradeoffs.
Compare with thisData Structures · Extended
Treap is a data-structure variant of Binary Search Tree with different update or query tradeoffs.
Compare with thisData Structures · Core
Skip lists provide ordered-map operations using layered lists instead of tree rotations.
Compare with thisProcedural Generation · Extended
BSP dungeon generation recursively partitions space in a tree-like structure.
Compare with thisAVL trees are self-balancing binary search trees.
Red-Black Trees are balanced binary search tree variants.