Algorithm Designa67-longest-path-dag
Longest Path in DAG
20b49c6f-9f5f-430b-9c20-6e8a5058d98c.cC
1// Loading code...Selected Submission
100 / 100
0.308s
4116 KB
BFS/DFSGraph
Time Comp.
O(V + E)
Space Comp.
O(V + E)
Readability
6/10
"The code performs a Depth-First Search (DFS) to find the maximum reachable value in a directed acyclic graph. It utilizes the in-degree of nodes to identify starting points for the DFS, and the algorithm explores paths to update the maximum reachable value."
History
| Attempt | Points | Time ↓ |
|---|---|---|
| Try #6 | 100 | 5/2/2025 |
| Try #5 | 100 | 5/2/2025 |
| Try #4 | 100 | 5/2/2025 |
| Try #3 | 60 | 5/2/2025 |
| Try #2 | 60 | 5/2/2025 |
| Try #1 | 65 | 5/2/2025 |