Last Updated : 18 Dec, 2018

Consider the given pseudocode given below.

binary_tree(r)
{
if(r==NULL)
{return (r)}
if(r->lc==NULL && r->rc==NULL)
{return (r)}
else{
t=r->rc
r->rc=binary_tree(r->lc)
r->lc=binary_tree(t)
return (r)
}
}

What does the program gives output?

(A) Interchange left and right subtree.

(B) Interchange left-child data and right-child data.

(C) It gives a mirror image of the binary tree.

(D) It counts the number of leaf nodes in left and right subtree.


Answer: (C)

Explanation:

Quiz of this Question


Share your thoughts in the comments