AlgoScope

BST Search

Compare with the node, go left if smaller, right if larger.

Tree algorithms, algorithm, beginner
Comparing 45 with node 30. 45 is larger, so move to the right child, node 40.203035404550607080current30 < 45

Binary Search Tree: Search for 45

Decision, step 3 of 6

45 is larger than 30: go right.

Cost

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

Leads to

Topics that need this one first.

Taught by the same lesson

Binary Search Tree covers these too, in the same run.