The Gateway to Computer Science Excellence
+2 votes
150 views
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

in DS by Boss (10.6k points)
recategorized by | 150 views
0
levels....

number of levels..
0
level try with single node it will give 1

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,292 answers
198,231 comments
104,914 users