Question
Which traversal method is most suitable for finding
connected components in an undirected graph?Solution
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.
An enterprise consumes 25,600 units of a component annually. The order cost is ₹600 per order, and carrying cost is ₹12/unit/year. A supplier offers...
Under Ind AS 116, a company leases an asset for 5 years. On transition, it recognizes a right-of-use asset and corresponding lease liability. However, t...
Financial accounting is mainly concerned with:
A company has the following capital structure: Equity ₹40 lakh, Preference ₹10 lakh, Debt ₹20 lakh. Cost of equity = 15%, cost of preference = 10%...
A company’s estimated tax liability for FY 2024–25 is ₹20 lakh. It has already paid ₹4 lakh in the first installment (15 June). Calculate the am...
During the loan appraisal process at banks, the term CMA Report refers to which of the following?
RXIL (Receivables Exchange of India Ltd.) is a joint venture of which two institutions?
It is the duty of the agent to protect and preserve the interest on behalf of the principal’s representative in case of _____
Which ICDS deals with Accounting Policies?
In the context of international financial regulation, the Financial Action Task Force (FATF) is primarily responsible for: