Better proposal
- Case I: P has no grandparent (that is, Parent(P) is the root). Perform a single rotation around the parent of P, as illustrated in Figure 7.21 or its mirror image.
- Case II: P and Parent(P) are both left children, or both right children: Perform two single rotations in the same direction, first around the grandparent of P and then around the parent of P as shown in Figure 7.22 or its mirror image.
- Case III: One of P and Parent(P) is a left child and the other is a right child: Perform single rotations in opposite directions, first around the parent of P and then around its grandparent, as illustrated in Figure 7.23 or its mirror image