(a) ---> (a1) ---->(b)
| >
| |
> |
(a2)--------------->(a3)
Consider this graph, vertex (a) has a path to vertex (b).
When we run dfs when starting from the top (a), the output is: (a), (a1), (b), (a2), (a3)
Summit (b) is visited after visit (a).
source
share