def recursive_dfs(graph, start, path=None):
if path is None:
path = []
path.append(start)
for node in graph[start]:
if not node in path:
recursive_dfs(graph, node, path)
return path
dfs
最新推荐文章于 2024-03-20 21:37:09 发布