Question

1.
2.
3.
4.
Answer (Detailed Solution Below)

Option 2 : A, B, C, D, E / A, B, C, D, E

Advertisement

Detailed Solution

सही उत्तर A, B, C, D, E / A, B, C, D, E है।

Key Points
Helpful?
PrepSnapprepsnap.in • Part -A

Question:

In a graph, A is adjacent to B and C; B is adjacent to D; C is adjacent to D and E. The breadth-first traversal starting from A, visiting neighbours in alphabetical order, is / एक ग्राफ में, A, B और C का आसन्न है; B, D का आसन्न है; C, D और E का आसन्न है। A से शुरू होने वाला चौड़ाई-प्रथम (breadth-first) ट्रैवर्सल, पड़ोसियों को वर्णमाला क्रम में देखते हुए, है

1.
A, B, D, C, E / A, B, D, C, E
2.
A, B, C, D, E / A, B, C, D, E
3.
A, C, B, E, D / A, C, B, E, D
4.
A, B, C, E, D / A, B, C, E, D

Correct Answer: A, B, C, D, E / A, B, C, D, E

BFS visits all of A's neighbours B and C before any of their neighbours; from B comes D and from C come D and E, giving the level order A, B, C, D, E. / BFS उनके पड़ोसियों से पहले A के सभी पड़ोसी B और C का भ्रमण करता है; B से D तथा C से D और E मिलता है, जिससे स्तर क्रम A, B, C, D, E बनता है।

Downloaded from PrepSnap (prepsnap.in)