io avevo fatto in questo modo:
ma resituisce sempre e solo true!!codice:public static <E> boolean bilanciato(BinaryTree<E> T){ if(T.isEmpty()) throw new EmptyTreeException("albero vuoto"); if(isProper(T,T.root())) return true; else return false; } public static <E> boolean isProper(BinaryTree<E>T, Position<E>nodo){ if((T.hasLeft(nodo) && T.hasRight(nodo))) return true; if(T.isInternal(nodo)){ for(Position<E> child:T.children(nodo)) if(isProper(T,child)) return true; } return false; } }