Professional KnowledgeHardIBPS SO IT

Which data structure does BFS use and which does DFS use (iterative)?

  1. A. Stack and queue
  2. B. Both queue
  3. C. Both stack
  4. D. Queue and stack

Correct answer: D. Queue and stack

BFS is level order via a queue; DFS uses a stack or recursion.

More IT Officer Professional Knowledge (IBPS SO) questions

Exams that ask this topic