Print all nodes at distance k from given node

can u give me a hint on how to solve this question?