Guest User

Untitled

a guest
Jun 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. def depth_first_search_recursive(graph, start, visited=None):
  2. if visited is None:
  3. visited = set()
  4. visited.add(start)
  5. for next in graph[start] - visited:
  6. depth_first_search_recursive(graph, next, visited)
  7. return visited
Add Comment
Please, Sign In to add comment