DS – AVL Rotations

AVL Rotations:

  • There are 4 rotations to balance the binary search tree
    • L-L-Rotation
    • R-R-Rotation
    • L-R-Rotation
    • R-L-Rotation
    • L-L rotation:
      • Left Child Left Heavy
      • Balance Factor of Parent is -2 and Left Child is -1
    • Single right rotation is required.
      • After rotation:
        • Left Child become Parent
        • Parent become right child
    • R-R rotation:
      • Right Child Right Heavy
      • Balance Factor of Parent is +2 and Child is +1
    • Single left rotation is required.
    • Right Node become Parent and Parent become Left child after rotation

    Scroll to Top