MC logo

After Inserting 22


AVL Tree Example

<<

Next: After Inserting 49 >>


Now we have inserted 22. For this insertion, A is the 14 node. We change the 0's at 52 and 37, then change 14 to -2. A rotation is required. Since the insertion point is right, left, left from A, we use RL(c). We note

A = 14, B = 52, C = 37

The C node moves to A's place, A moves down left, and the 22 node (the left subtree of C) becomes the right subtree of A.