Tree Rotation
A tree rotation is a local restructuring operation that changes parent-child relationships while preserving the inorder ordering of a BST. Rotations are fundamental to self-balancing trees such as AVL and Red-Black Trees. The purpose is to reduce or redistribute tree height without changing the sorted sequence of keys.
Left and right rotations are the basic operations.
Rotations take O(1) time.
They preserve BST inorder ordering.
AVL Trees use rotations to restore balance.
Red-Black Trees use rotations together with recoloring.