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


/* * rotateRightLeft */ private void rotateRightLeft(TreeNode subRoot, TreeNode prev) { /* * INSERT YOUR CODE HERE. */ }
/* * rotateLeftRight */ private void rotateLeftRight(TreeNode subRoot, TreeNode prev) { /* * INSERT YOUR CODE HERE. */ }
private void This method calls rotate Right with rotateRightLeft(TreeNode subRoot's right child. Then, it calls subRoot, TreeNode prev) rotate Left on the subRoot itself. private void This method calls rotateLeft with rotate LeftRight(TreeNode subRoot's left child. Then, it calls subRoot, TreeNode prev) rotateRight on the subRoot itself. class TreeNode I public int key; public TreeNode left; public TreeNode right; public int balFactor; /* * constructor */ public TreeNode(int key) { this.key = key; left = right = null; balFactor 0; } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
