Pr-4 AVL
Pr-4 AVL
}
RR Rotation
avl_node* avlTree:: RR_rotation (avl_node *parent)
{
avl_node* temp = parent->right; parent
temp->left = parent;
return temp;
} return address
parent
LR Rotation temp
return address
avl_node* avlTree:: LR_rotation (avl_node *parent)
{
avl_node *temp = parent->left;
parent->left = RR_rotation (temp); //calling RR rotation
return LL_rotation (parent);
// return root after LL rotation
}
parent
RL Rotation temp
return address