Which data structure is used to implement breadth-first search (BFS) of a graph?
2024
Which data structure is used to implement breadth-first search (BFS) of a graph?
- A.
Queue
- B.
Stack
- C.
LinkedList
- D.
None of the above
Attempted by 518 students.
Show answer & explanation
Correct answer: A
Breadth-first search (BFS) is implemented using a Queue. BFS visits the nodes in a graph level by level.