I am working on making an AVL tree in Java, I need help finishing my roatation methods, rightRotate() is not working so I have not yet attempted rotateLeft(); public class MyAVLNode { private MyAVLNode left, right, parent; private int element, height; public MyAVLNode getRight() { return right; } public void setRight(MyAVLNode right) { this.right = right; } public MyAVLNode getLeft() { return left; } public void setLeft(MyAVLNode left) { this.left = left; } public MyAVLNode getParent() { return parent; } public void setParent(MyAVLNode parent) { this.parent = parent; } public int getElement() { return element; } public void setElement(int element) { this.element = element; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } } public class MyAVLTree { private MyAVLNode root; public MyAVLTree() { root = null; } private MyAVLNode createNode(int element) { MyAVLNode temp = new MyAVLNode(); temp.setElement(element); temp.setLeft(null); temp.setRight(null); temp.setParent(null); temp.setHeight(0); return temp; } private void inorder(MyAVLNode current) { if(current!=null) { inorder(current.getLeft()); System.out.println(current.getElement() + " "+current.getHeight()); inorder(current.getRight()); } } public void print() { inorder(root); } private int getBalanceFactor(MyAVLNode current) { int leftChildHeight = current.getLeft()==null ? -1 : current.getLeft().getHeight(); int rightChildHeight = current.getRight()==null ? -1 : current.getRight().getHeight(); return rightChildHeight - leftChildHeight; } private void rightRotate(MyAVLNode current) { MyAVLNode oldParent = current.getParent(); MyAVLNode grandparent = oldParent.getParent(); if(grandparent==null) { root = current; } else { if(grandparent.getElement() < current.getElement()) { grandparent.setRight(current); } else { grandparent.setLeft(current); } current.setParent(grandparent); oldParent.setLeft(current.getRight()); current.getRight().setParent(oldParent); current.setRight(oldParent); oldParent.setParent(current); } } private void leftRotate(MyTreeNode current){ } private void updateHeight(MyAVLNode current) { if(current!=null) { int leftChildHeight = current.getLeft()==null ? -1 : current.getLeft().getHeight(); int rightChildHeight = current.getRight()==null ? -1 : current.getRight().getHeight(); //check if current is balanced if(Math.abs(rightChildHeight-leftChildHeight)>1) { //unbalanced, fix if(getBalanceFactor(current)==-2) { //left case if(getBalanceFactor(current.getLeft())==-1) { //left left case rightRotate(current.getLeft()); } else { //left right case } } else { //right case } } else { //if it is balanced, update heights current.setHeight(Math.max(leftChildHeight, rightChildHeight)+1); updateHeight(current.getParent()); } } } private void insert(MyAVLNode current, MyAVLNode insertMe) { if(current.getElement()<insertMe.getElement()) { //look to the right if(current.getRight()==null) { //structure things current.setRight(insertMe);.