Which of the following is useful in traversing a given graph by breadth-first…
20182018
Which of the following is useful in traversing a given graph by breadth-first search (BFS)?
- A.
Stack
- B.
Set
- C.
List
- D.
Queue
Attempted by 428 students.
Show answer & explanation
Correct answer: D
BFS explores vertices level by level, and a queue is used to store and process vertices in the order they are discovered.