previous | start | next

Fix Unbalanced Node with rotateLeft

Returning to the example AVL tree, we try to insert 190:

The rotateLeft(Node t) method is called where t is the unbalanced Node (100 in this example) to rotate the t and its right child to the left.

The result is

What happened? How many links were changed?

What is the code for void rotateLeft(Node t)?



previous | start | next