Question: /* * rotateLeft */ private void rotateLeft(TreeNode subRoot, TreeNode prev) { /* * INSERT YOUR CODE HERE. */ } /* * rotateRight */ private void

 /* * rotateLeft */ private void rotateLeft(TreeNode subRoot, TreeNode prev) {

/* * rotateLeft */ private void rotateLeft(TreeNode subRoot, TreeNode prev) { /* * INSERT YOUR CODE HERE. */ }

/* * rotateRight */ private void rotateRight(TreeNode subRoot, TreeNode prev) { /* * INSERT YOUR CODE HERE. */ }

/* * rotateRightLeft */ private void rotateRightLeft(TreeNode subRoot, TreeNode prev) { /* * INSERT YOUR CODE HERE. */ }

/* * rotateLeftRight */ private void rotateLeftRight(TreeNode subRoot, TreeNode prev) { /* * INSERT YOUR CODE HERE. */ }

------>>> These are the methods that you need to change,(( in same place where it's there's comment " YOUR CODE HERE."))

------->>>Just put it in the correct place as required within the schedule

private void This method replaces subRoot with its rotateLeft(TreeNode right child and makes the subRoot the left subRoot, TreeNode prev) child of the child that replaced it. private void This method replaces subRoot with its left rotate Right(TreeNode child and makes the subRoot the right subRoot, TreeNode prev) child of the child that replaced it. private void This method calls rotate Right with rotate RightLeft(TreeNode subRoot's right child. Then, it calls subRoot, TreeNode prev) rotate Left on the subRoot itself. private void This method calls rotateLeft with rotateLeftRight(TreeNode subRoot's left child. Then, it calls subRoot, TreeNode prev) rotate Right on the subRoot itself. private void This method replaces subRoot with its rotateLeft(TreeNode right child and makes the subRoot the left subRoot, TreeNode prev) child of the child that replaced it. private void This method replaces subRoot with its left rotate Right(TreeNode child and makes the subRoot the right subRoot, TreeNode prev) child of the child that replaced it. private void This method calls rotate Right with rotate RightLeft(TreeNode subRoot's right child. Then, it calls subRoot, TreeNode prev) rotate Left on the subRoot itself. private void This method calls rotateLeft with rotateLeftRight(TreeNode subRoot's left child. Then, it calls subRoot, TreeNode prev) rotate Right on the subRoot itself

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 Databases Questions!