AlgoScope

BST Delete

A leaf just goes, one child is spliced past, two children need a successor.

Tree algorithms, algorithm, intermediate
Comparing 30 with node 50. 30 is smaller, so move to the left child, node 30.203035404550607080current50 > 30

Binary Search Tree: Delete a node with two children (30)

Decision, step 2 of 8

30 is smaller than 50: go left.

How binary search tree works

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.