Chapter 10
Graphs & Graph Algorithms
6 topics in 1 parts
Key ideas
| Approach | Time Complexity | Auxiliary Space | Key Limitation |
|---|---|---|---|
| Brute Force Approach | O(N²) or O(2ᴺ) | O(1) / Minimal | Times out on large constraints ($N > 10^4$) |
| Optimal Approach | O(N) or O(N log N) | O(1) / O(N) | Requires sorted invariant or hash set lookup |
| Theoretical Lower Bound | Ω(N) | O(1) | Must inspect every element at least once |
All 6 topics in Graphs & Graph Algorithms
Graphs
- Graph Representations
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- Cycle Detection in Graphs
- Dijkstra's Algorithm
- Topological Sort & Kahn's Algorithm