Skip to content
RED SAGSkills
medium10 pts · first answer countsgraphsdfs

Iterative DFS visiting a different order

You replace recursive DFS with a loop that pushes all neighbours onto a stack in list order. Why might the visit order differ from the recursive version?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions