Answer Posted / om
struct tree //creating structure
{
int data; //data field of node
struct tree *lchild,*rchild;//left child & right child of node
};
//for depth calculation
int depth(struct tree *p)
{
int l,r;
if(p!=NULL)
{
l=depth(p->lchild);
r=depth(p->rchild);
return (1+((l>r)?l:r));
}
return -1;
}
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Why dont c comments nest?
How do I copy files?
how to construct a simulator keeping the logical boolean gates in c
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
How are variables declared in c?
How do you determine the length of a string value that was stored in a variable?
Explain can you assign a different address to an array tag?
Write a program to check prime number in c programming?
The statement, int(*x[]) () what does in indicate?
What is the g value paradox?
write a program to print data of 5 five students with structures?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What are the Advantages of using macro
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What do you mean by a local block?