int depth(node *root)
{
return root ? max(depth(root-left), depth(root-right)) : 0;
}
On Aug 8, 8:03 am, jagrati verma jagrativermamn...@gmail.com wrote:
finding the depth or height of a tree.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
int depth(node *root)
{
return root ? 1+max(depth(root-left), depth(root-right)) : 0;
}
On Aug 8, 8:03 am, jagrati verma jagrativermamn...@gmail.com wrote:
finding the depth or height of a tree.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
@Don: Beautiful!
Dave
On Aug 10, 10:03 am, Don dondod...@gmail.com wrote:
int depth(node *root)
{
return root ? 1+max(depth(root-left), depth(root-right)) : 0;
}
On Aug 8, 8:03 am, jagrati verma jagrativermamn...@gmail.com wrote:
finding the depth or height of a tree.
--
You
I do love functions that start with return.
Don
On Aug 10, 10:09 am, Dave dave_and_da...@juno.com wrote:
@Don: Beautiful!
Dave
On Aug 10, 10:03 am, Don dondod...@gmail.com wrote:
int depth(node *root)
{
return root ? 1+max(depth(root-left), depth(root-right)) : 0;
}
On Aug 8,