private void RotateLeft(TextAnchorNode p)
{
// let q be p's right child
var q = p.right;
Debug.Assert(q != null);
Debug.Assert(q.parent == p);
// set q to be the new root
ReplaceNode(p, q);
// set p's right child to be q's left child
p.right = q.left;
if (p.right != null) p.right.parent = p;
// set q's left child to be p
q.left = p;
p.parent = q;
UpdateAugmentedData(p);
UpdateAugmentedData(q);
}