| I need | Use | Cost |
| Look up by key, count, dedupe | Map / Set | O(1) |
| Items in arrival order | Queue | O(1) |
| Most recent first, undo, matching | Stack | O(1) |
| Smallest or largest, repeatedly | Heap | O(log n) |
| Sorted data that changes, ranges | Balanced BST / B+tree | O(log n) |
| Prefix lookups | Trie | O(word length) |
| Find in sorted array, minimum that works | Binary search | O(log n) |
| Fewest hops | BFS | O(V + E) |
| Cheapest weighted path | Dijkstra | O((V + E) log V) |
| Order with dependencies | Topological sort | O(V + E) |
| Merge groups, are they connected | Union-find | about O(1) |
| All combinations | Backtracking | exponential |
| Best answer from overlapping subproblems | DP | states × work |
| O(1) lookup plus O(1) ordering | Map + doubly linked list (LRU) | O(1) |