Print all nodes at distance k from a given node

https://ide.codingblocks.com/s/165303 getting 2 test cases wrong

Faizan, pls sort the values first and then print it, the output produced by the code is not in the sorted manner, thts why it is failing in those test cases, …Try to make the changes and then submit…