Answer Posted / crispin
/*
* Simple tree node representation
*/
struct node_t {
struct node_t *left;
struct note_t *right;
};
/*
* Return the maximum depth of the tree given a pointer
* to its root node.
*/
unsigned int
tree_depth (node_t *root)
{
return (NULL == root) ? 0 :
MAX(tree_depth(root->left, root->right)+1);
}
| Is This Answer Correct ? | 3 Yes | 6 No |
Post New Answer View All Answers
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
How can I recover the file name given an open stream or file descriptor?
What is string in c language?
What is the purpose of type declarations?
What is the use of void pointer and null pointer in c language?
Tell me is null always defined as 0(zero)?
Explain how can you tell whether a program was compiled using c versus c++?
Why is c still so popular?
c program to compute AREA under integral
What is the best organizational structure?
How to write a multi-statement macro?
When should you not use a type cast?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
Compare and contrast compilers from interpreters.
How can I sort a linked list?