search
Log In
1 vote
262 views

in Algorithms 262 views
1
c should be answer
0
can you explain?
0
Can you please explain..

1 Answer

2 votes
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

4 votes
1 answer
1
0 votes
0 answers
2
223 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)$
asked Nov 13, 2018 in Algorithms Lakshman Patel RJIT 223 views
1 vote
1 answer
3
0 votes
0 answers
4
337 views asked Nov 7, 2018 in Programming Na462 337 views
...