This commit is contained in:
2023-05-23 08:47:25 +02:00
parent 67c0279de0
commit eab1c93cfd

View File

@@ -424,14 +424,13 @@ public class Baum<T extends Comparable<T>>
// return out;
// }
private int hoeheRek(final Knoten<T> einKnoten)
{
private int hoeheRek(final Knoten<T> einKnoten) {
if(einKnoten == null){
return 0;
int hoehe = 0;
if (einKnoten != null) {
return Math.max(hoeheRek(einKnoten.getKnotenRechts()), hoeheRek(einKnoten.getKnotenLinks())) + 1;
}
return Math.max(hoeheRek(einKnoten.getKnotenRechts(),hoeheRek(einKnoten.getKnotenLinks());
return hoehe;
}
}