Gate2017 ss Q17

0. 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? if P is root Node.

  • Option : D
  • Explanation :
    BFS: Start at root (some arbitrary node of a graph, sometimes referred to as “search key”) and explore the neighbor nodes first, before and moving to the next level neighbors.
    by using this we have different :
    POQNMR or PQOMNR
    So only D is correct answer
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 *