private void removeNodeWithOneChild(Node u)
    {
        Node n = (u.right == null) ? u.left : u.right;
        if (n.isRed)    n.isRed = false;
        if (u == root)
        {
            root = n;
            u.left = null;
            u.right = null;
        }
        else
        {
            if (u.parent.left == u) u.parent.left = n;
            else    u.parent.right = n;
            n.parent = u.parent;
        }
        u.parent = null;
    }