Which data structure is primarily associated with Depth First Search (DFS)?

Options

  • A. Stack
  • B. Queue
  • C. Hash table only
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

A. Stack

Detailed Explanation

Depth First Search (DFS) explores one branch as deeply as possible before backtracking. It can be implemented using a stack, either explicitly or through recursion.