previous | start | next

Example Requiring Two Rotations

If we try to insert 425 into this tree, node 500 would then violate the AVL condition. However, we can't use the rotateRight method:

First rotate 400 to the left with its new right child (425), and then rotate 500 with its new left child (425 again in a new position) to the right to get:



previous | start | next