recategorized by
675 views

2 Answers

0 votes
0 votes

Option B won't be correct  as it will print all the nodes in kth level. 

It's a kind of Depth First traversal . Has it been a Breadth First type, your conjecture may be teated correct. 

So, I think option A  is correct.

0 votes
0 votes

Option B would be discarded as It is saying about kth level Nodes of BINARY TREE ,

But this program is for all node present at  K distance from a given node  ,(could be any other node in tree )

then It will print all the nodes at distance of K from that given node.

Note : Option B will be correct if in function Argument we are passing tree root node then It will print Kth level Nodes of Binary Tree.

Related questions

0 votes
0 votes
1 answer
1
Prince Sindhiya asked Jan 2, 2019
705 views
A full binary tree is a tree in which every node other than the leaves has two children. If there are 600 leaves then total number of leaf nodes are?
2 votes
2 votes
3 answers
2
4 votes
4 votes
2 answers
3
Parth Shah asked Dec 11, 2018
1,388 views
Suppose binary tree has only three nodes A,B and C, and you are given the post order traversal of tree as B-A-C . The exact pre order traversal of the tree is?A)C-A-BB)A-...
1 votes
1 votes
2 answers
4
CHïntän ÞäTël asked Dec 10, 2018
982 views
four vertices {A,B,C,D} is given which has only vertex D as a leaf total number of binary tree are possible when every binary tree has four node!