Question: Problem 2 . ( 3 6 points ) Answer each of the following problems assuming that Figure 1 shows an AVL tree. In Figure 1

Problem 2.(36 points) Answer each of the following problems assuming that Figure 1 shows an
AVL tree. In Figure 1, ni for i =0,1,,8 denotes the memory address of a node.
(a)(9 points) Assume that t refers to the AVL tree shown in Figure 1. Draw the tree that would
result from executing t.add(1). Justify your answer.
(b)(9 points) Assume that t refers to the AVL tree shown in Figure 1. Draw the tree that would
result from executing t.add(4). Justify your answer.
(c)(9 points) Assume that t refers to the AVL tree shown in Figure 1. Draw the tree that would
result from executing t.remove(6). Justify your answer.
(d)(9 points) Assume that t refers to the AVL tree shown in Figure 1. Draw the tree that would
result from executing t.remove(2) and then t.remove(7). Justify your answer.
Problem 2 . ( 3 6 points ) Answer each of the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!