private void removeNodeWithTwoChildren(Node u)
    {
        Node n = getNext(u);
        u.key = n.key;
        Node removedsRight = n.right;
        if (n.parent == u)
        {
            u.right = removedsRight;
            if (removedsRight != null)   removedsRight.parent = u;
        }
        else
        {
            n.parent.left = removedsRight;
            if (removedsRight != null)   removedsRight.parent = n.parent;
        }
        if (isRed(removedsRight))
            removedsRight.isRed = false;
        else    balanceOnRemoval(n);
        n.right = null;
        n.parent = null;
    }