Which of the following are not AVL trees?
This problem walks through one example of AVL insertion.
18
is inserted using BST
insert (i.e., no rebalancing yet).In the resulting tree, label heights and balance factors of each node.
If we’re doing AVL insert, the recursion will walk back up the
tree after the new node is inserted, calling rebalance
on
each parent node in succession. What nodes have rebalance
called on them, and in what order?
Which call(s) to rebalance
result in rotations? What
are the rotations? For each rebalance
call that modifies
the tree, draw the tree after the appropriate rotations are
performed.
Repeat the same four subproblems from #2, but beginning with the following tree, and inserting the value 16 instead of 18.