GATE CSE
First time here? Checkout the FAQ!
x
0 votes
90 views

 

Whats wrong with option B?

Give an example?

asked in Programming by Junior (775 points) 2 10 35 | 90 views

2 Answers

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.

answered by (445 points) 1 3 7
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.

 

answered by (81 points) 1 5

Related questions

+15 votes
1 answer
2
asked in GATE by pC Veteran (22.8k points) 46 215 355 | 741 views
+1 vote
0 answers
3


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23240 Points

  2. Bikram

    17038 Points

  3. Habibkhan

    7096 Points

  4. srestha

    6008 Points

  5. Debashish Deka

    5430 Points

  6. jothee

    4928 Points

  7. Sachin Mittal 1

    4762 Points

  8. joshi_nitish

    4278 Points

  9. sushmita

    3954 Points

  10. Rishi yadav

    3744 Points


Recent Badges

Popular Question neha singh
Notable Question tajar
Notable Question Imarati Gupta
Notable Question set2018
Popular Question jothee
Notable Question set2018
Notable Question Pavan Kumar Munnam
Notable Question iarnav
Popular Question makhdoom ghaya
Popular Question Satyam
27,254 questions
35,075 answers
83,756 comments
33,185 users