Missing node in the output of my Depth-First Search

后端 未结 0 1436
深忆病人
深忆病人 2021-01-03 00:37
graph = {}

def dfs(graph, node, visited):
    if node not in visited:
        visited.append(node)
        for n in graph[node]:
            dfs(graph,n, visited)
          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题