Q.Which of the following is useful in traversing a given graph by breadth-first search (BFS)?
Correct answer: Queue
Explanation
A queue data structure is useful in traversing a given graph by breadth first search because it maintains the order in which the vertices are visited it easy to visit all the vertices at the same level before moving to the next level.
A queue data structure is useful in traversing a given graph by breadth first search because it maintains the order in which the vertices are visited it easy to visit all the vertices at the same level before moving to the next level.