Question
/* * rotateLeft */ private void rotateLeft(TreeNode subRoot, TreeNode prev) { /* * INSERT YOUR CODE HERE. */ } /* * rotateRight */ private void
/* * 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 itselfStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started