找到最小值

//找到最小值 public E minimum(){
    if(size==0){
        throw new IllegalArgumentException("BST is empty.");
    }
    return minimun(root).e;
}

private Node minimun(Node node){
    if(node.left==null)
        return node;
    return minimun(node.left);
}

删除最小值

//删除最小值 public E remove(){
    E ret=minimum();
    root=removeMin(root);
    return ret;
}

private Node removeMin(Node node){
    if(node.left==null){
        Node nodeRight=node.right;
        node.right=null;
        size--;
        return nodeRight;
    }
    node.left=remove(node.left);

    return node;
}