All lessonsOpen Open Open Open Open
8. Trees
BST operations
0 of 5 activities0%
Reading 1
Editing the tree
Insert: walk like search, hang a new leaf.
Min: go left; Max: go right.
Delete: 0 children — remove; 1 child — bypass; 2 children — replace with inorder successor/predecessor then delete that node.
Successor: leftmost of right subtree.
Check 2
Minimum
In a non-empty BST, the minimum is found by
Fill in 3
Next key
Try it 4
Find min
Leftmost.
main.cpp
Loading editor…
Output will appear here.
Assignment 5
Min of list
Read n and n ints. Print the minimum (BST min idea).
main.cpp
Loading editor…