Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure DFS(G, v) is
- label v as discovered
- for all directed edges from v to w that are in G.adjacentEdges(v) do
- if vertex w is not labeled as discovered then
- recursively call DFS(G, w)
- inverse_topo[i++] = v // post-processing, i start with 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement