Exercise #2
For each of the sequences below
- start from an initially empty binary search tree
- show the tree resulting from inserting the values in the order given
(a) 4 2 6 5 1 7 3
(b) 5 3 6 2 4 7 1
(c) 1 2 3 4 5 6 7
Assume ...
-
Item s are keys, all keys are unique (no duplicates)
- new values are always inserted as new leaf nodes
|