How do you program a method that calculates the height of a tree?
How do you program a recursive method in Java that calculates the height of a tree? It's kind of complicated. Here's the method header:
protected int tellmepleasetheheightofthetree(BinaryTree baum){
I can't get any further with my thoughts here.
Also grundlegend bräuchtest du erst mal Variablen, aus denen man die Höhe berechnen kann. Weil: “Sag höhe Baum” funktioniert nicht.
So?
Du solltest mal bitte genau erklären, was du machen möchtest.
Ich will eine Methode die die Höhe des Baumes baum (in den Klammern) zurückgibt.
Rechtwinkliges Dreieck ist gar nicht kompliziert. Gradmessung per Peilung und fertig.