binary tree - a spesific node's height !
hello ! im looking for a method to deterine a certain node's hight in a binary tree (that is its distance from the root ) please enlighten me on how to do this if you can thank you
[209 byte] By [
JungleRata] at [2007-10-2 12:17:15]

Algorithm: height (Tree, n)
if n is the root of Tree then
return 0;
else
return 1 + height(Tree, p) // p is the parent of n in Tree
Now, you may start writing your code.