Skip to content
Treesintro

BST Search

Locates a key by descending from the root, comparing at each node and branching left or right. The ordering invariant means each comparison discards an entire subtree — logarithmic time on a balanced tree.

Best
O(1)
Average
O(log n)
Worst
O(n)
Space
O(1)