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
If null and 0 are equivalent as null pointer constants, which should I use?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What is array within structure?
Difference between malloc() and calloc() function?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
What is the deal on sprintf_s return value?
Write a progarm to find the length of string using switch case?
State two uses of pointers in C?
What is storage class?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What are data types in c language?
the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset
What is static function in c?
Explain what is meant by high-order and low-order bytes?