DFS

Hide text Hide pseudo-code

Visit the nodes in DFS order. Start with the node A.

Some additional problems.

Algorithm DFS(G)

  1. for each u ∈ V[G] do
  2.      visited[u] ← false
  3.      finished[u] ← false
  4. for each u ∈ V[G] do
  5.      if visited[u] = false
  6.           DFS-VISIT(G, u)


  Created Fri Oct 30 13:52:50 EET 2009 - Powered by SVG-hut