Quick Reference Tables, Common Mistakes, Last-Minute Tips
Your problem sets (ps1-sol.pdf through ps8-sol.pdf) are in the Assignment_answer_sols folder. These are gold!
| Algorithm/Structure | Time Complexity | Space | Notes |
|---|---|---|---|
| BFS | O(V + E) | O(V) | Queue, level-by-level |
| DFS | O(V + E) | O(V) | Stack/recursion, depth-first |
| Topological Sort | O(V + E) | O(V) | DFS-based, DAGs only |
| SCC (Kosaraju) | O(V + E) | O(V) | Two DFS passes |
| Dijkstra's | O((V+E) log V) | O(V) | Non-negative weights only |
| Strassen's | O(n^2.81) | O(n²) | 7 multiplications |
| Activity Selection | O(n log n) | O(1) | Sort by finish time |
| Huffman Coding | O(n log n) | O(n) | Min-heap based |
| Kruskal's MST | O(E log E) | O(V) | Sort edges, Union-Find |
| Prim's MST | O((V+E) log V) | O(V) | Grow from vertex, min-heap |
| Matrix Chain Mult. | O(n³) | O(n²) | DP, optimal parenthesization |
| LCS | O(mn) | O(mn) | DP, 2D table |
| Ford-Fulkerson | O(E·|f*|) | O(V+E) | Augmenting paths |
| Edmonds-Karp | O(VE²) | O(V+E) | BFS for paths |