題組內容

5. This question concerns with the Depth First Search (DFS) or Depth First Traversal algorithm.

(a) It is common to implement the DFS algorithm with a Stack. However, the stack may be used differently in different implementations. You are tasked to implement the DFS algorithm for any given graphs. Explain how you are going to use the stack in your implementation.(7%)