I have put all important DSA sheets here so you do not need to move from one place to another to find them. I work in Java and follow Striver closely, so I value his sheet highly. The order reflects my own views and I have noted the best use case for each sheet so you can choose what fits your goal. Everything here supports interview preparation and competitive programming, along with some personal useful points below the links.
Direct Link: https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/
Direct Link: https://drive.google.com/file/d/1FMdN_OCfOI0iAeDlqswCiC2DZzD4nPsb/view
Direct Link: https://neetcode.io/practice
Direct Link: https://docs.google.com/spreadsheets/u/0/d/1-wKcV99KtO91dXdPkwmXGTdtyxAfk1mbPXQg81R9sFE/htmlview
Direct Link: https://docs.google.com/spreadsheets/u/0/d/1hXserPuxVoWMG9Hs7y8wVdRCJTcj3xMBAEYUOXQ5Xag/htmlview
Direct Link: https://docs.google.com/spreadsheets/d/1MGVBJ8HkRbCnU6EQASjJKCqQE8BWng4qgL0n3vCVOxE/edit#gid=0
Direct Link: https://docs.google.com/spreadsheets/d/1kyHfGGaLTzWspcqMUUS5Httmip7t8LJB0P-uPrRLGos/edit#gid=0
- Binary search
- Two pointers
- Backtracking
- DFS
- BFS
- DFS
- BFS
- Two pointers
- Stack
- Swap corresponding values
- Store several values inside the same pointer
- Dynamic programming
- Heap
- QuickSelect
- Map
- Trie
- Map or Set for O(1) time and O(n) space
- Sort input for O(n log n) time and O(1) space
- "Minimum number of operations"
- "Choose the best option at each step"
- "Maximum sum"
- "Minimum cost"
- "Number of ways"
- "Subsequence"
- "Longest substring"
- "Subarray with..."
- "Kth smallest"
- "Search in sorted"
- "Minimize the maximum"
- "Network"
- "Connections"
- "Paths"
Click to View: How to Approach Any DSA Question
- Read the constraints carefully. Identify if the expected solution is O(n), O(n log n), or O(1).
- Look for keywords that map to common patterns.
- Identify if the problem reduces to a known template.
- Break the problem into smaller parts and validate assumptions with sample tests.
- Start with a simple brute force approach and refine to an optimal method.
- Check for edge cases at boundaries.