Binary tree question
-
what is max
-
what is max
And how to call the function? I mean what has to be the second argument innerDepth. I call it with the tree and the Height as second argument and it gives me 4, 3, 1 as output. I need only 4.
-
Yes I define my own Max function, but why the output is 4,3,1 and not only 4?
-
Yes I define my own Max function, but why the output is 4,3,1 and not only 4?
-
And how to call the function? I mean what has to be the second argument innerDepth. I call it with the tree and the Height as second argument and it gives me 4, 3, 1 as output. I need only 4.
-
i think the return should be
// and return the depth this node represents return currentDepth+(maxDepth,rightdepth);
maxDepth is? and why is it in brackets? Is it a function or something? i don' t know
-
maxDepth is? and why is it in brackets? Is it a function or something? i don' t know
OK I think I did it it has to be
return currentDepth - leftDepth + rightDepth;
-
OK I think I did it it has to be
return currentDepth - leftDepth + rightDepth;
Now If you can explain me how the whole function works...
-
maxDepth is? and why is it in brackets? Is it a function or something? i don' t know
-
Now If you can explain me how the whole function works...