The Breadth First Search (BFS) algorithm has been implemented using the queue…

GATE · 2017 · CS · Set 2 · Computer Science & IT

The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the graph below?

  1. A.

    \(\text{MNOPQR}\)

  2. B.

    \(\text{NQMPOR}\)

  3. C.

    \(\text{QMNROP}\)

  4. D.

    \(\text{POQNMR}\)

Attempted by 603 students.

Show answer

Correct answer: D

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…