✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Mille leiab järgmine meetod etteantud kahendpuu puhul?
int leia(Tipp juur) {
int vastus = 0;
if (juur != null) {
if (juur.vasak != null)
vastus = 1 + leia(juur.vasak);
if (juur.parem != null)
vastus = Math.max(vastus, 1 + leia(juur.parem));
}
return vastus;
}