Question discussion

Which data structure is used to implement breadth-first search (BFS) of a graph?

1349Medium DSSSB TGT Computer Science 0 replies 1 views
0

Which data structure is used to implement breadth-first search (BFS) of a graph?

  • AStack
  • BHeap
  • CQueue
  • DBinary search tree
Correct answer: C

Explanation

BFS visits vertices level by level, so it uses a queue (DFS uses a stack).

Discussion 0

Nobody has replied yet. Start the discussion!