Print all nodes at dist k from a given node

can you please explain the ouput for 65 2 as 70 in the given question

https://ide.codingblocks.com/s/121455 link for the code

@neeleshr628 For the given sample case: the tree formed would be something like this:
11

2
60 1
65 2

The first output should be 65, 70 as nodes 65 and 70 are the only nodes at distance 1 from node 60.
The second output should be 70 as 70 is the only node at distance 2 from node 65. This should be clear from the above tree structure.Note that distance depend on the number of edges you are traversing in order to reach a particular node. To reach node 70 from node 65, you are traversing 2 edges, so distance is 2.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.