All lessons

8. Trees

BST operations

0 of 5 activities0%

Reading 1

Editing the tree

Open

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

Open

In a non-empty BST, the minimum is found by

Fill in 3

Next key

Open

The next larger key is the inorder

Try it 4

Find min

Open

Leftmost.

main.cpp
Loading editor…
Output will appear here.

Assignment 5

Min of list

Open

Read n and n ints. Print the minimum (BST min idea).

main.cpp
Loading editor…