DSA Revision Sheet - Quick Guide
1. Arrays & Strings
- Two Pointers, Sliding Window, Prefix Sum
- Common Qs: Two Sum, Longest Substring Without Repeating Characters, Maximum Subarray
2. Linked List
- Singly, Doubly, Fast & Slow Pointer (Tortoise)
- Common Qs: Reverse LL, Detect Cycle, Merge Two Sorted LL
3. Stack & Queue
- LIFO/FIFO, Monotonic Stack, Deque
- Common Qs: Valid Parentheses, Min Stack, Sliding Window Maximum
4. Trees & Binary Trees
- DFS, BFS, Traversals, BST properties
- Common Qs: Inorder/Preorder Traversal, Lowest Common Ancestor
5. Binary Search
- Search in Rotated Array, BS on Answer
- Common Qs: Median of Two Sorted Arrays, First/Last Occurrence
6. Recursion & Backtracking
- Try all possibilities, Backtrack when invalid
- Common Qs: Subsets, Permutations, N-Queens
7. Dynamic Programming
- Memoization, Tabulation, 0/1 Knapsack, LIS
- Common Qs: Climbing Stairs, House Robber, Longest Palindromic Substring
8. Graphs
- Adjacency List/Matrix, BFS/DFS, Union Find
- Common Qs: Number of Islands, Topological Sort, Dijkstra's Algo
9. Greedy Algorithms
- Choose best local option for global result
- Common Qs: Activity Selection, Huffman Coding, Job Scheduling
10. Bit Manipulation
- AND, OR, XOR, Bit Shift, Masking
- Common Qs: Single Number, Power of Two, Counting Bits
11. Heap/Priority Queue
- Min Heap / Max Heap, K largest/smallest elements
- Common Qs: Merge K Sorted Lists, Top K Frequent Elements