More algorithms for printing all nodes at distance k from a node