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)?

  1. A.

    Stack

  2. B.

    Set

  3. C.

    List

  4. 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.

Explore the full course: Up Lt Grade Assistant Teacher 2025