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.
Which of the following is a result of a well-functioning financial market?
Which type of planning is typically focused on the long-term objectives of an organization?
What do ethical standards provide a framework for?
Consider the following statements about the budget allocations of fiscal year 2023-24 across the ministries and choose which is the correct answer.
Accounting Standards do not permit following method of inventory valuation:
What does D in SDR by IMF stand for?
Which premium banking service has YES Bank introduced to cater to affluent and elite customers?
Who regulates the insurance sector in India?
The term “financial creditor” in the Insolvency and Bankruptcy Code (IBC) in India means?
The Union Cabinet recently approved National Green Hydrogen Mission. The initial outlay for the Mission will be _________.