Why This Matters
Most DSA mistakes are choice mistakes. The code may be syntactically correct, but the learner picked the wrong representation, traversal, or optimization pattern.
This hub collects the comparison pages that make those choices explicit.
Decision Map
| If you are choosing between... | Start here |
|---|---|
| contiguous storage and pointer-based nodes | Array vs Linked List |
| LIFO and FIFO processing | Stack vs Queue |
| graph traversal styles | BFS vs DFS |
| shortest path with negative weights | Dijkstra vs Bellman-Ford |
| shortest path with a heuristic | Dijkstra vs A* |
| heap implementation and priority queue abstraction | Heap vs Priority Queue |
| prefix search and key lookup | Trie vs Hash Table |
| local choices and recurrence tables | Dynamic Programming vs Greedy |
| top-down and bottom-up DP | Memoization vs Tabulation |
| finding best k items | Top-K Selection vs Sorting |
| graph memory layout | Adjacency List vs Adjacency Matrix |
| ordered search and unsorted scanning | Binary Search vs Linear Search |
How To Use These Pages
Read the comparison page before solving a problem. Then name the decision in one sentence:
I am using BFS rather than DFS because the graph is unweighted and the goal is the fewest edges.
If you cannot write that sentence, the algorithm choice is not ready yet.
References
- MIT OpenCourseWare. 6.006 Introduction to Algorithms, Spring 2020: https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/
- MIT OpenCourseWare. 6.046J Design and Analysis of Algorithms, Spring 2015: https://ocw.mit.edu/courses/6-046j-design-and-analysis-of-algorithms-spring-2015/