I have the following method, but I want to use recursion; however, I get an error: "missing return statement".
static String buscar(NodoDeArbol raiz, String letra) {
if(raiz == null) {
aux="";
for (int i = 0; i < auxiliar.length()-1; i++) {
aux+=auxiliar.charAt(i);
}
return aux;
}
auxiliar = buscar(raiz.izquierdo, auxiliar+= "0");
auxiliar = buscar(raiz.derecho, auxiliar+= "1");
}
What should to do to fix this?
void- it has to return something of the declared type. I also suggest that you post the relevant part of your code into your question.