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
How are pointers declared in c?
What is the newline escape sequence?
Explain continue keyword in c
Explain what is gets() function?
Explain 'bus error'?
What are the Advantages of using macro
What is the acronym for ansi?
What is c method?
What is #define used for in c?
Can you please explain the difference between syntax vs logical error?
Explain pointers in c programming?
Can you please explain the difference between strcpy() and memcpy() function?
What does s c mean in text?
What is the difference between āgā and āgā in C?
What is indirection?