442 views
0 votes
0 votes

there are multiple algorithm of DFS available and i cant figure out which one to follow for solving question asking for the nodes which aren’t pushed into the stack or the nodes which are pushed more than once,

Tried to figure out from already asked question but still can’t get it,

https://gateoverflow.in/98484/dfs-using-stack

https://gateoverflow.in/161225/dfs-number-of-nodes-not-pushed-into-the-stack

1 Answer

0 votes
0 votes
Always use the standard algorithm which uses Stack until and unless mentioned the other way around.

Related questions

1 votes
1 votes
2 answers
2
Gate Aspirant 2 asked Dec 19, 2014
2,489 views
Which of the following statement is correct regarding DFS? 1) All the vertices are pushed in the stack during DFS Traversal. 2) No vertex is pushed more than once in the ...