Consider the following procedure struct. and assume Height = level -1; gate…
Consider the following procedure struct. and assume Height = level -1;
gate (root)
{
if (root = = null) return 0;
if (root → leftchild = = null && root → rightchild = = null) return 1;
else return (maximum (gate(root → leftchild), gate(root → rightchild)) + 1);
}
What is the functionality of above function?
- A.
Returns the height of binary tree
- B.
Returns number of leaf nodes in the binary tree
- C.
Returns number of levels in the binary tree
- D.
None of these
Attempted by 282 students.
Sign up free to check your answer
Sign up freeLoading lesson…

