AVL.c
// A utility function to right rotate subtree rooted with y
// See the diagram given above.

A utility function to right rotate subtree rooted with y
See the diagram given above.
A utility function to right rotate subtree rooted with y See the diagram given above .
struct Node *rightRotate(struct Node *y)
{
	struct Node *x = y->left;
	struct Node *T2 = x->right;
	x->right = y;
	y->left = T2;
	y->height = maximum(height(y->left), height(y->right)) + 1;
	x->height = maximum(height(x->left), height(x->right)) + 1;
	return x;
}
struct Node * rightRotate ( struct Node * y ) { struct Node * x = y -> left ; struct Node * T2 = x -> right ; x -> right = y ; y -> left = T2 ; y -> height = maximum ( height ( y -> left ) , height ( y -> right ) ) + 1 ; x -> height = maximum ( height ( x -> left ) , height ( x -> right ) ) + 1 ; return x ; }
A utility function to right rotate subtree rooted with y
See the diagram given above.
A utility function to right rotate subtree rooted with y See the diagram given above .
// Perform rotation
 // Update heights
 // Return new root
