Question: In the AVLTree class the method doubleWithLeftChild performs a double rotation for case 2 and the method doubleWithRightChild performs a double rotation for case 3.
In the AVLTree class the method doubleWithLeftChild performs a double rotation for case 2 and the method doubleWithRightChild performs a double rotation for case 3. Instead of using separate methods to perform the double rotation for ease 2 and 3, the AVLTree class can use just one method, called doubleRotation. The method doubleRotation has three parameters k1, k2, k3, each pointing to the correct nodes when calling doubleRotation for case 2 and when calling doubleRotation fur case 3. On the next page are all the methods from the AVLTree class and its nested Node class Which you might need to write the code for this question. Write the code for the method doubleRotation for the AVLTree class: private Node
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
