|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| • |
Depth-First
Search
|
|
|
|
– |
Because
the graph is connected, DFS will visit
|
|
|
every
vertex. In fact, the traversal could visit the
|
|
|
vertices
in this order:
|
|
|
a
b c d g e f h i
|
|
|
|
– |
Notice
a stack of vertices can be used to implement
|
|
this
approach -- where the last one visited is
|
|
|
|