Algorithm Designa60a_q3_component
Connected Component
0bbcad1d-7917-4209-8a27-a548c72b5cf5.cppC++
1// Loading code...Selected Submission
100 / 100
0.014s
3616 KB
BFS/DFSGraph
Time Comp.
O(V + E)
Space Comp.
O(V + E)
Readability
5/10
"The code performs a Depth-First Search (DFS) on a graph represented by an adjacency list to count the number of connected components. It iterates through unvisited nodes and explores their reachable nodes until no more unvisited nodes are reachable from the current component."
History
| Attempt | Points | Time ↓ |
|---|---|---|
| Try #3 | 100 | 3/19/2025 |
| Try #2 | 100 | 3/19/2025 |
| Try #1 | 100 | 3/19/2025 |