recategorized by
442 views
2 votes
2 votes
int find(Struct Node *root){

int a = 0, b = 0, c = 0;
if(root == NULL) return 0;
if(root-->left == NULL && root--->right == NULL) return 1;
else
a = find(root--->left);
b = find(root--->right);
c = 1 + max(a,b);
return c;
}

What does the above code find?

a) #levels

b) height of a rooted tree

recategorized by

Please log in or register to answer this question.

Related questions

2 votes
2 votes
3 answers
1
0 votes
0 votes
0 answers
2
10 votes
10 votes
5 answers
3
Tushar Shinde asked Jan 18, 2016
4,032 views
The number of ways we can insert elements { 1, 2, 3, .... 7 } to make an AVL tree, so that it does not have any rotation are _______ ?
0 votes
0 votes
1 answer
4
Sandeep Singh asked Dec 27, 2015
473 views
Consider the below code which run on any tree.In-order traversalPost-order traversalPre-order traversalNone of these