Driver code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = 4 NEW_LINE K = 3 NEW_LINE adj = [ [ ] for i in range ( N + 1 ) ] NEW_LINE adj = addEdge ( adj , 1 , 2 ) NEW_LINE adj = addEdge ( adj , 2 , 3 ) NEW_LINE adj = addEdge ( adj , 3 , 4 ) NEW_LINE DFS ( adj , N ) NEW_LINE DEDENT