Graph Algorithm 17

0. The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the nodes of the following graph is

  • Option : C
  • Explanation :
    Applying BFS Algorithms
    Starting from Q
    Queue Q
    Making Q’s child’s status 1.
    Queue
    Q| M| N| P
    Making M’s child 1 (which are not 1)
    Status
    QMNOPR
    211 1 
    221 11
    222111
    Q| M| N| P| R
    Making N’s Child 1
    Q| M| N| P| R| O
    (other are already 1)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *