TRAKLA2
Index
Research
Support
DFS
Hide text
Show text
Hide pseudo-code
Show pseudo-code
Task
Instructions
Visit the nodes in DFS order.
Some additional
problems
.
Clicking on a node the first time marks the node visited.
Clicking on a node the second time marks the node finished.
DFS
DFS-VISIT
Algorithm
DFS
(G)
for each
u ∈ V[G]
do
visited[u] ← false
finished[u] ← false
for each
u ∈ V[G]
do
if visited[u] = false
DFS-VISIT(G, u)
Algorithm
DFS-VISIT
(G, u)
visited[u] ← true
for each
v ∈ Adj[u]
do
if
visited[v] = false
then
DFS-VISIT(G, v)
finished[u] ← true
Created Wed Jun 20 16:00:43 EEST 2007 - Powered by
SVG-hut