Sum + Subarray | Prefix Sum |
Largest / Smallest / k-th in sorted | Heap / Quickselect |
Arrange to Find Max / Min | Heap / Sort with Compare |
Competing Choices / Select or Skip | Dynamic Programming |
Remember Seen | Hashset / Hashmap |
String Prefix | Trie |
Pattern / Substring Matching | Rolling Hash / KMP |
Repeated Sorting | Sorted List / Ordered Set |
Binary Tree | Recursive Traverse / DFS |
Count Steps in Graph / Matrix | BFS |
Connectivity / Groups in Graph | Disjointed Set |
Cycle Detection in Graph | Disjointed Set |
Hash On or Off | Bitmask |
DAG / Dependency / Causation | Topological Sort |
Next Greater / Smaller | Mono Stack |
In-place | Swap / Sorting / Two Pointers |
Perm / Subset / Matrix Traverse / On or Off | Backtracking |
Find First / Last Good Candidate | Binary Search |
Given k , find max / min | Binary Search |
Find kth Element | Binary Search |
Range Sum / Count in Rolling Sorted Array | Binary Index Tree / Segment Tree |
Range Max / Min | Segment Tree |
Balance / Last Few / Deletion | Stack |
Count / Min / Max Subarray | Sliding Window |
Count / Min / Max Subseq | Dynamic Programming |
Subseq Pattern Matching | Dynamic Programming |
Partition to k Subset / Knapsack | Dynamic Programming |