DFS(G = (V,E))DFS-VISIT(G,u)
- for each vertex $u \in V$
- u.color = unexplored
- u.parent = null
- time = 0
- for each vertex $u \in V$
- if u.color = unexplored
- DFS-VISIT(G,u)
- time = time + 1
- u.start = time
- u.color = active
- for each $v \in u.Adj$ do
- if v.color = unexplored
- v.parent = u
- DFS-VISIT(G,v)
- u.color = done
- time = time + 1
- u.finish = time;