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

Answer: D. QueueBFS explores vertices level by level, and a queue is used to store and process vertices in the order they are discovered.

  1. A.

    Stack

  2. B.

    Set

  3. C.

    List

  4. D.

    Queue

Attempted by 1122 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: Rssb Basic Computer Instructor

Loading lesson…