GATE 2017 [Set-2]
November 16, 2023Question 7978 – GATE 2017 [Set-2]
November 16, 2023Question 7977 – GATE 2017 [Set-2]
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?
Correct Answer: D
Question 15 Explanation:
The possible order of visiting the nodes in Breadth First Search Algorithm, implementing using Queue Data Structure is
(Do it by option Elimination)
(a) MNOPQR – MNO is not the proper order R must come in between.
(b) NQMPOR – QMP is not the order O is the child of N.
(C) QMNROP – M is not the child of Q, so QMN is false.
(D) POQNMR – P → OQ → NMR is the correct sequence. Hence Option (D).
(Do it by option Elimination)
(a) MNOPQR – MNO is not the proper order R must come in between.
(b) NQMPOR – QMP is not the order O is the child of N.
(C) QMNROP – M is not the child of Q, so QMN is false.
(D) POQNMR – P → OQ → NMR is the correct sequence. Hence Option (D).
MNOPQR
NQMPOR
QMNROP
POQNMR
Subscribe
Login
0 Comments