# DFS- Depth First Search

1 vote
262 views

1
0
can you explain?
0

 V6(3,8) V3(1,7) V7(8) V8(4,5) V5(2) V2(1,4) V4() V1()

because it is DFS use the stack. in bracket i have put the node adjacent to the vertex.

0
I think there is something wrong with this solution Plz Cross check.. Because initially while accessing 6 you have inserted 3 and 8 it means they are visited according to algorithm.. You cannot again push 8 while accessing 7 even you can't pop 8 until the above elements are not popped

## Related questions

1
225 views
Consider the following sequence of nodes for the undirected graph given below$:$ $(1)PQSTWVUR$ $(2)PQRSTUWV$ $(3)PQRTUSVW$ A Depth First Search (DFS) is started at node $P.$The nodes are listed in the order they are first visited. Which all of the above are possible outputs$?$ $A)Only (2)$ $B)(1) and (2)$ $C)(2) and (3)$ $D)(1) and (2)$