Академический Документы
Профессиональный Документы
Культура Документы
Rotation Algorithm
}
ELSE
{
Perform Left rotation
}
}
ELSE IF tree is left heavy (B.F. = -2)
{
IF tree's left sub tree is right heavy (B.F. = 2 / 1)
{
Perform Right-Left Rotation (RL) rotation
}
ELSE
{
Perform Right rotation
}
}
ROTATIONS
Left – Left Case Right – Right Case
( Right Rotation ) ( Left Rotation )
0 -1
0 0
0
0