Start learning 50% faster. Sign in now
Depth-First Search (DFS) is ideal for finding connected components in an undirected graph. Starting from an unvisited vertex, DFS explores all reachable vertices, marking them as visited. Each DFS call identifies one connected component, and the process is repeated for all unvisited vertices. Steps: 1. Initialize all vertices as unvisited. 2. Perform DFS from each unvisited vertex. 3. Each DFS traversal marks a connected component. DFS is efficient, with a time complexity of O(V+E), making it well-suited for sparse and dense graphs. Why Other Options Are Incorrect: 1. BFS: Can also find connected components but requires more memory due to queue-based implementation. 2. Topological Sort: Applies to Directed Acyclic Graphs (DAGs) and does not determine connected components. 3. Dijkstra’s Algorithm: Finds shortest paths, not connected components. 4. Floyd-Warshall Algorithm: Computes all-pairs shortest paths, unsuitable for this task.
Heroine, one of the major chemicals responsible for drug abuse, is obtained from:
Which of the following functions or powers are not performed by SEBI (Securities and Exchange Board of India), as mentioned in the statement?
The Foreign Exchange Management Act (FEMA) is related to what aspect?
The International Fintech Institute (IFI), established with a $23 million loan agreement between India and ADB, is aimed at promoting fintech education ...
As per the World Bank data, what was the population of India at the end of 2021?
Jat-Jatin is one of the most popular folk dance form of which among the following states?
Which is not correct regarding SVAMITVA scheme: -
Which of the following statements is/are correct about the neighbouring countries of India?
(A) India supported Maldives in 2022 with a grant o...
Which of the following statements related to the launch of Platform of Platforms (POP) are correct?
1) The Union Minister of Agriculture and Farm...
Which of the following village is declared to be India’s first 24*7 solar powered village?