void leftRotate(RedBlackNode x)
    {
    	RedBlackNode y = x.right;		// set y
    	x.right = y.left;				// turn y's left subtree into x's right subtree
    	if(y.left != nil)
    		y.left.parent = x;
    	y.parent = x.parent;			// link x's parent to y
    	if(x.parent == nil)
    		root = y; 
    	else if (x == x.parent.left)
    		x.parent.left = y;
    	else
    		x.parent.right = y;
    	y.left = x;						// put x on y's left
    	x.parent = y;
    }