13,138 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

5 votes
5 votes
3 answers
1
sh!va asked May 7, 2017
4,383 views
Which of the following algorithms solves the all pair shortest path problem?Prim's algorithmDijkstra's algorithmBellman ford algorithmFloyd warshalls algorithm
6 votes
6 votes
1 answer
2
sh!va asked May 7, 2017
18,571 views
The best data structure to check whether an arithmetic expression has balanced parenthesis is a:QueueStackTreeList
29 votes
29 votes
7 answers
3
15 votes
15 votes
7 answers
4
Kathleen asked Sep 18, 2014
11,658 views
The problem $\text{3-SAT}$ and $\text{2-SAT}$ are both in $\text{P}$both $\text{NP}$ complete$\text{NP}$-complete and in $\text{P}$ respectivelyundecidable and $\text{NP}...