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 are the characteristics of arrays in c?
#include
What is the difference between procedural and declarative language?
Which built-in library function can be used to match a patter from the string?
How can I determine whether a machines byte order is big-endian or little-endian?
Where static variables are stored in memory in c?
swap 2 numbers without using third variable?
what do you mean by inline function in C?
What is size of union in c?
In C programming, what command or code can be used to determine if a number of odd or even?
Explain goto?
code for quick sort?
How can I find the modification date and time of a file?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
What is the difference between new and malloc functions?