Disculpame Phicar , con este código:
void cantnodos(Arbol a,int b)
{
if ((a->hi==NULL)&&(a->hd==NULL))
{if (b<min)
min=b;
return;
}
else
{
if ((a->hi!=NULL)&& (a->hd!=NULL))
return(cantnodos(a->hi,b+1));
else
if((a->hd!=NULL)&& (a->hi==NULL))
return(cantnodos(arbol->hd,b+1));
else
if((a->hi!=NULL)&& (a->hd==NULL))
return(cantnodos(a->hi,b+1));
}
}
Me resuelve siempre el sub-árbol izquierdo de la raíz ya que si la raíz tiene dos hijos va entrar por el condicional
if ((a->hi!=NULL)&& (a->hd!=NULL))
return(cantnodos(a->hi,b+1));
que pasa si el camino mínimo esta en el sub-árbol derecho? No lo supervisa.