Depth-first search: Difference between revisions

From Algowiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:


==== DFS(''G'') ====
==== DFS(''G'') ====
1 '''for''' each vertex ''u'' &isin; ''V'' [''G''] <br/>
1:'''for''' each vertex ''u'' &isin; ''V'' [''G''] <br/>
2     '''do''' color['''u'''] &larr; WHITE
2::'''do''' color['''u'''] &larr; WHITE <br/>
3
3<br/>
4
4<br/>
5
5<br/>
6
6<br/>

Revision as of 16:18, 14 August 2014

Definition

Pseudocode

DFS(G)

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