DFS on graphs
Prereq: Graph Intro
Similar to BFS, we just have to add visited
to keep track of visited nodes and use get_neighbors
to get the next nodes to visit.
Loading full content...
Prereq: Graph Intro
Similar to BFS, we just have to add visited
to keep track of visited nodes and use get_neighbors
to get the next nodes to visit.