public void remove(E e)
    {
        Node u = find(e);
        if (u == null)
            return;
        
        if (size <= 1)  min = null;
        else if (min != null && e == min.key)  //nullpointer
            min = getNext(min);
        
        size--;
        if (u.left == null && u.right == null)
            removeNodeWithoutChildren(u);
        else if (u.left != null && u.right != null)
            removeNodeWithTwoChildren(u);
        else    removeNodeWithOneChild(u);
        if (root != null)   root.parent = null;
    }