How to determine the height of a binary tree

Hi,

Quote:

> Can anyone here help me? Our class was given a homework to write a recursive

> function that can determine the height of binary (standard Binary tree ADT).

> And so far, I haven't been able to do the function as I just can't seem to

> figure out the logic of writing the recursive function.

For any given node, the height of the tree on top of which it sits is one

plus the height of the trees under it (if they are not equal in height,

take the greater one).

That should pretty much explain it, because it is a recursive definition,

and if you start with the tree's root, the height you calculate from there

is the height of the whole tree.

- Sebastian

--

Always remember: "Batch" is NOT a programming language!