question: private void rotateRight ( Node < K , V > root ) { Node < K , V > pivot = root . left ; Node < K , V > right = root . right ; Node < K , V > pivotLeft = pivot . left ; Node < K , V > pivotRight = pivot . right ; root . left = pivotRight ; if ( pivotRight != null ) { pivotRight . parent = root ; } replaceInParent ( root , pivot ) ; pivot . right = root ; root . parent = pivot ; root . height = Math . max ( right != null ? right . height : 0 , pivotRight != null ? pivotRight . height : 0 ) + 1 ; pivot . height = Math . max ( root . height , pivotLeft != null ? pivotLeft . height : 0 ) + 1 ; }
target:  Rotates the subtree so that its root's left child is the new root.