public int hoehe(){ lengh = new int[list.size()]; int max; max = 0; if(list == null){ return 1;} else { int i=0; int count = 0; for (Knoten s : list) { i = i + s.hoehe() + 1; lengh[count] = i; count++; i = 0; } for(int t=0; t < lengh.length; t++) { if (lengh[t]> max){ max = lengh[t]; } } return max; } }
public int hoehe(){ public int hoehe(){ if (wurzel == null) { return 1; } else return wurzel.hoehe() + 1; // +1 für die Wurzel } }