Homework 06: AVL rotations
Name: _____________________________________________ Alpha: ___________________
Describe help received: ________________________________________________________
- Due before class on Friday, October 7
- This is a written homework - be sure to turn in a hard-copy of your completed assignment at the beginning of class on the deadline.
In the following tree, annotate each node with the HEIGHT of that node.
Is the tree for the previous question an AVL tree? Why or why not?
If not, what rotation(s) are needed to make it an AVL tree?
(You don’t have to actually do the rotations, but be specific about what kind of rotation(s) and at which node(s).)
Rebalance the following tree by performing a single rotation at node 34.
Rebalance the following tree by performing a double rotation at node 76.
Starting with an initially empty tree, draw the AVL tree that results after inserting the following keys, one at a time, in this order:
P, R, U, C, B, Q, D, F.
Besides showing the final tree, you must also re-draw the tree and clearly indicate every time a rotation occurs.
Starting with the following AVL tree, draw the tree that results after removing node 36 and rebalancing appropriately.