Consider the following sequences of nodes for the undirected graph shown…
GATE · 2008 · IT
Consider the following sequences of nodes for the undirected graph shown below:

a b e f d g c
a b e f c g d
a d g e b c f
a d b c g e f
A Depth First Search (DFS) is started at node a. The nodes are listed in the order they are first visited. Which of the above can be produced as DFS outputs?
- A.
1 and 3 only
- B.
2 and 3 only
- C.
2, 3 and 4 only
- D.
1, 2, and 3
Attempted by 245 students.
Sign up free to check your answer
Sign up freeLoading lesson…