Question: points) In the AVL Tree class the method doubleWithLefiChild and the method double With RightChild performs a methods to implement the double rotation for case
points) In the AVL Tree class the method doubleWithLefiChild and the method double With RightChild performs a methods to implement the double rotation for case 2 and 3, the A doubleRotation. The method double ha nodes when calling double Rotation for case 2 and when performs a double rotation for double rotation for case 3. Instead of using otation has three parameters: kl, k2, k3, each pointing to the correct calling double Rotation for case 3 methos from the A VI Tree class and its nested Node class which you might need to wrie class AVLTree AnyType extenda Comparablec? super AnyType the code for this question. private static class NodecAnyType public NodecAnyTypes getLeft return lefti public NodecAnyType> getRight ) return right public int getHeight return height: public void setLeft (Node cAnyType> 1) (lett 1; public void setRight (NodecAnyType> r) right - public void setHeight (int h) height - h) private int getHeight (NodecAnyTypes t) return ((tull) t.getHeight O) private void setHeight (NodecAnyType t) int leftChildHeight getHeight (t.getLeft )) int rightchildHeight getHeight (t.getRight )) t.setHeight (Math.max(leftChildHeight, rightchildHeight) 1) In the Balance method the call to doubleRotation will replace the call to doubleWithLeftChild which performs a double rotation for case 2. The variable t is the root of the subtree that needs to be rebalanced. Fill in the three parameters for doubleRotation on the line below so that it will perform a double rotation for case 2 tdoubleRotation ( In the Balance method the call to doubleRotation will replace the call to doubleWithRightChild which performs a double rotation for case 3. The variable t is the root of the subtree that needs to be rebalanced. Fill in the three parameters for doubleRotation on the line below so that it will perform a double rotation for case 3. doubleRo tation(
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
