<DS/>DS_VISUALIZER
FoundationsOOPArraysLinked ListStacksQueuesTreesGraphsHashingStrings
exploreExplore
homechevron_rightTopicschevron_rightTreeschevron_rightAvl Treechevron_rightRotations
rotate_right

AVL TREE · ROTATIONS

Rotations

The four imbalance cases and their fixes.

Choose a case

rotate_rightarrow_outward

LL Rotation

Left-left → one right rotation.

O(1)O(1)◍ 0/6
rotate_leftarrow_outward

RR Rotation

Right-right → one left rotation.

O(1)O(1)◍ 0/6
syncarrow_outward

LR Rotation

Zig-zag: rotate child, then pivot.

O(1)O(1)◍ 0/6
syncarrow_outward

RL Rotation

Zig-zag: rotate child, then pivot.

O(1)O(1)◍ 0/6