Depth-first search: Difference between revisions

From Algowiki
Jump to navigation Jump to search
(Created page with "== Definition == === Pseudocode === ==== DFS(''G'') === 1 '''for''' each vertex ''u'' ∈ ''V''[''G''] 2 '''do''' color['''u'''] ← WHITE 3 4 5 6")
 
No edit summary
Line 5: Line 5:
=== Pseudocode ===  
=== Pseudocode ===  


==== DFS(''G'') ===
==== DFS(''G'') ====
1 '''for''' each vertex ''u'' ∈ ''V''[''G'']
1 '''for''' each vertex ''u'' ∈ ''V''[''G'']
2 '''do''' color['''u'''] ← WHITE
2 '''do''' color['''u'''] ← WHITE

Revision as of 16:03, 14 August 2014

Definition

Pseudocode

DFS(G)

1 for each vertex uV[G] 2 do color[u] ← WHITE 3 4 5 6