RR RotationIf the node is inserted into the right of the right subtree of a node A and the tree becomes unbalanced then, in that case, RR rotation will be performed as shown in the following diagram. While the rotation, the node B becomes the root node of the tree. The critical node A will be moved to its left and becomes the left child of B. The subtree T3 becomes the right subtree of A. T1 and T2 becomes the left and right subtree of node A. ExampleInsert 90 into the AVL Tree shown in the figure. Solution :90 is inserted in to the right of the right subtree. In this case, critical node A will be 85, which is the closest ancestor to the new node, whose balance factor is disturbed. Therefore, we need to rebalance the tree by applying RR rotation onto it. The node B will be the node 90 , which will become the root node of this subtree. The critical node 85 will become its left child, in order to produce the rebalanced tree which is now an AVL tree.
Next TopicDoubly Linked List
