blob: 18bad31fcecb81942f79df35a0fc2cffd6a77efc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
DFS categorized directed graph
tree: 0 --> 2
tree: 2 --> 1
back: 1 --> 1
tree: 1 --> 3
back: 3 --> 1
tree: 3 --> 4
back: 4 --> 0
back: 4 --> 1
forward or cross: 2 --> 3
BFS categorized directed graph
tree: 0 --> 2
tree: 2 --> 1
tree: 2 --> 3
cycle: 1 --> 1
cycle: 1 --> 3
cycle: 3 --> 1
tree: 3 --> 4
cycle: 4 --> 0
cycle: 4 --> 1
|