Which rotation is generally required to correct an RR imbalance in an AVL tree?

Options

  • A. Right rotation
  • B. Left rotation
  • C. Right-left rotation
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

B. Left rotation

Detailed Explanation

An RR (Right-Right) imbalance occurs when insertion takes place in the right subtree of the right child of an unbalanced node. It is corrected using a single left rotation. The purpose of the rotation is to reduce the height imbalance while maintaining the BST ordering property. The corresponding LL case uses a right rotation. LR and RL are the two double-rotation cases in an AVL tree.