13,221 views
10 votes
10 votes

Which of the following data structure is useful in traversing a given graph by breadth first search?

  1. Stack
  2. Queue
  3. List
  4. None of the above

8 Answers

Best answer
15 votes
15 votes

Breadth-first search  uses a Queue data structure.

https://en.wikipedia.org/wiki/Breadth-first_search#More_details

selected by
2 votes
2 votes
Queue is used to implement traveral in Breadth First Search.

Stack is used to implement traversal in Depth First Search.
Answer:

Related questions

6 votes
6 votes
1 answer
1
sh!va asked May 7, 2017
18,624 views
The best data structure to check whether an arithmetic expression has balanced parenthesis is a:QueueStackTreeList
5 votes
5 votes
3 answers
2
sh!va asked May 7, 2017
4,440 views
Which of the following algorithms solves the all pair shortest path problem?Prim's algorithmDijkstra's algorithmBellman ford algorithmFloyd warshalls algorithm
0 votes
0 votes
0 answers
3
Tuhin Dutta asked Dec 12, 2017
372 views
Starting vertex is : $V_1$Find the BFS traversal sequence