<reponame>joseluan/ArvoreBinariaBusca<filename>src/br/com/luan/model/ArvoreBinariaBusca.java
package br.com.luan.model;

public class ArvoreBinariaBusca {
    private Node raiz = null;

    public boolean isEmpty() {
        return raiz == null;
    }

    public Node getRoot() {
        return raiz;
    }
    
    public Node remove(int value) {
    	return this.raiz.searchFather(value);
    }
    
    
    public Node getMaxFolha() {
    	return raiz.getMaxValue();
    }

    public void insert(Node node) {
        if (raiz == null) {
            raiz = node;
            return;
        }
        raiz.insert(node);
    }

    public void insert(int value) {
        Node n = new Node(value);
        insert(n);
    }

    public Node search(int key) {
        if (raiz == null) {
            return null;
        }
        return raiz.search(key);
    }

}
