Connected components in a graph can be found using which graph traversalएक ग्राफ में जुड़े घटकों को किस ग्राफ ट्रैवर्सल एल्गोरिथ्म का उपयोग करके पाया जा सकता है?
Connected components in a graph can be found using which graph traversal
algorithm?
एक ग्राफ में जुड़े घटकों को किस ग्राफ ट्रैवर्सल एल्गोरिथ्म का उपयोग करके पाया जा सकता है?
Show answerHide answer
Correct answer: (A) DFSडीएफएस
Explanation
Note: the answer key gives (A), but BFS finds connected components just as well as DFS: each traversal started from an unvisited vertex marks exactly one component. So (C) is the more accurate answer.नोट: आधिकारिक उत्तर कुंजी (A) देती है, लेकिन BFS connected component उतनी ही अच्छी तरह खोजता है जितना DFS: अनदेखे शीर्ष से शुरू हर traversal ठीक एक component चिह्नित करता है। इसलिए (C) अधिक सटीक उत्तर है।