Rotation Algorithm

Pivot: deepest imbalanced node.

Rotator: root of pivot's taller subtree.

        

Step 4: Join inside subtree to pivot in place of rotator.

Step 5: Join pivot to rotator in place of inside subtree.

Step 6: Join rotator to pivot's original parent in place of pivot.