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
What is meant by errors and debugging?
What does c in a circle mean?
What are the uses of null pointers?
Write a program to use switch statement.
How to delete a node from linked list w/o using collectons?
Why flag is used in c?
What does != Mean in c?
Between macros and functions,which is better to use and why?
Which is better oop or procedural?
how many key words availabel in c a) 28 b) 31 c) 32
What is calloc malloc realloc in c?
What are 'near' and 'far' pointers?
How do you generate random numbers in C?
Can we add pointers together?
What are the string functions? List some string functions available in c.