If the sequence of vertices visited in a BFS structure of a graph is $G =…

2019

If the sequence of vertices visited in a BFS structure of a graph is $G = (V,E)$ is $ABCD$, then which of the following is correct?

  1. A.

    G can be a complete graph

  2. B.

    G can be a cycle

  3. C.

    G can be a tree

  4. D.

    All of the above

Attempted by 39 students.

Show answer & explanation

Correct answer: D

A BFS visit order of ABCD can occur in a complete graph, a cycle, or a tree depending on the start vertex and adjacency order. Therefore all listed graph types are possible.

Explore the full course: Coding For Placement