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.
L @ K * J * I @ G @ H % F, How is J related to H?
A # B’ means ‘A is the brother of B’.
‘A @ B’ means ‘A is the daughter of B’.
‘A & B’ means ‘A is the husband of B’....
Statements: T ≥ S > H = O, R ≥ M > H
Conclusions : I. S > M II. R > O
If L is mother of M’s father then which of the following is true?
What is the relationship between J and F?
How is J related to L if ‘D @ G & J ? M # L’ is true?
If expression ‘R % T $ S # U $ V’ is true, then how is wife of V related to T’s mother?
In the given relationship, ____ is related to ____ in the same way as M is related to E.
Answer the following question based on the direction given below.
If 'A#B' means 'A is the father of B'
'A@B' means 'A is the brother of B...