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?

  1. A.

    Returns the height of binary tree

  2. B.

    Returns number of leaf nodes in the binary tree

  3. C.

    Returns number of levels in the binary tree

  4. D.

    None of these

Attempted by 282 students.

Sign up free to check your answer

Sign up free

Explore the full course: Isro

Loading lesson…