DFS is often implemented using _______ recursion or an explicit _______ data structure.

  • Head, Queue
  • Head, Stack
  • Tail, Queue
  • Tail, Stack
DFS is often implemented using tail recursion or an explicit stack data structure. Recursion provides a natural way to track the depth-first nature of the algorithm, while an explicit stack can be used to simulate the recursive call stack.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *