0% found this document useful (0 votes)
40 views

DSA patterns and problems

The document outlines various algorithmic techniques and data structures, categorized into sections such as Arrays and Strings, Linked Lists, Trees and Graphs, Dynamic Programming, and more. Each section lists specific problems or tasks associated with the respective technique, providing a comprehensive overview of common coding challenges. The content serves as a resource for understanding and practicing different algorithmic strategies.

Uploaded by

yoyaf84931
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

DSA patterns and problems

The document outlines various algorithmic techniques and data structures, categorized into sections such as Arrays and Strings, Linked Lists, Trees and Graphs, Dynamic Programming, and more. Each section lists specific problems or tasks associated with the respective technique, providing a comprehensive overview of common coding challenges. The content serves as a resource for understanding and practicing different algorithmic strategies.

Uploaded by

yoyaf84931
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

1.

Array and Strings


• Sliding Window
1. 3. Longest Substring Without Repeating Characters
2. 76. Minimum Window Substring
3. 567. Permutation in String
4. 438. Find All Anagrams in a String
5. 424. Longest Repeating Character Replacement
• Two Pointers
1. 15. 3Sum
2. 16. 3Sum Closest
3. 11. Container With Most Water
4. 42. Trapping Rain Water
5. 88. Merge Sorted Array
• Prefix Sum
1. 560. Subarray Sum Equals K
2. 238. Product of Array Except Self
3. 523. Continuous Subarray Sum
4. 525. Contiguous Array
5. 974. Subarray Sums Divisible by K
• Kadane's Algorithm
1. 53. Maximum Subarray
2. 121. Best Time to Buy and Sell Stock
3. 152. Maximum Product Subarray
4. 198. House Robber
5. 213. House Robber II
2. Linked List
• Reverse Linked List
1. 206. Reverse Linked List
2. 92. Reverse Linked List II
3. 25. Reverse Nodes in k-Group
4. 234. Palindrome Linked List
5. 143. Reorder List
• Fast and Slow Pointers
1. 141. Linked List Cycle
2. 142. Linked List Cycle II
3. 876. Middle of the Linked List
4. 19. Remove Nth Node From End of List
5. 160. Intersection of Two Linked Lists
• Merge Two Lists
1. 21. Merge Two Sorted Lists
2. 23. Merge k Sorted Lists
3. 148. Sort List
4. 147. Insertion Sort List
5. 86. Partition List
• Cycle Detection
1. 141. Linked List Cycle
2. 142. Linked List Cycle II
3. 287. Find the Duplicate Number
4. 457. Circular Array Loop
5. 202. Happy Number
3. Trees and Graphs
• Binary Tree Traversal
1. 94. Binary Tree Inorder Traversal
2. 144. Binary Tree Preorder Traversal
3. 145. Binary Tree Postorder Traversal
4. 102. Binary Tree Level Order Traversal
5. 103. Binary Tree Zigzag Level Order Traversal
• BFS
1. 102. Binary Tree Level Order Traversal
2. 107. Binary Tree Level Order Traversal II
3. 199. Binary Tree Right Side View
4. 637. Average of Levels in Binary Tree
5. 515. Find Largest Value in Each Tree Row
• DFS
1. 104. Maximum Depth of Binary Tree
2. 110. Balanced Binary Tree
3. 124. Binary Tree Maximum Path Sum
4. 543. Diameter of Binary Tree
5. 337. House Robber III
• BST Operations
1. 98. Validate Binary Search Tree
2. 235. Lowest Common Ancestor of a Binary Search Tree
3. 700. Search in a Binary Search Tree
4. 701. Insert into a Binary Search Tree
5. 450. Delete Node in a BST
• Graph Traversal
1. 133. Clone Graph
2. 200. Number of Islands
3. 207. Course Schedule
4. 210. Course Schedule II
5. 785. Is Graph Bipartite?
4. Dynamic Programming
• 1D DP
1. 70. Climbing Stairs
2. 198. House Robber
3. 300. Longest Increasing Subsequence
4. 53. Maximum Subarray
5. 1143. Longest Common Subsequence
• 2D DP
1. 64. Minimum Path Sum
2. 62. Unique Paths
3. 221. Maximal Square
4. 63. Unique Paths II
5. 120. Triangle
• Knapsack Pattern
1. 416. Partition Equal Subset Sum
2. 494. Target Sum
3. 474. Ones and Zeros
4. 518. Coin Change 2
5. 1049. Last Stone Weight II
• Subsequence Pattern
1. 300. Longest Increasing Subsequence
2. 1143. Longest Common Subsequence
3. 1035. Uncrossed Lines
4. 1092. Shortest Common Supersequence
5. 392. Is Subsequence
5. Sorting and Searching
• Binary Search
1. 33. Search in Rotated Sorted Array
2. 34. Find First and Last Position of Element in Sorted Array
3. 74. Search a 2D Matrix
4. 153. Find Minimum in Rotated Sorted Array
5. 162. Find Peak Element
• Merge Sort
1. 912. Sort an Array
2. 148. Sort List
3. 315. Count of Smaller Numbers After Self
4. 493. Reverse Pairs
5. 327. Count of Range Sum
• Quick Sort
1. 215. Kth Largest Element in an Array
2. 75. Sort Colors
3. 912. Sort an Array
4. 973. K Closest Points to Origin
5. 347. Top K Frequent Elements
• Heap Sort
1. 215. Kth Largest Element in an Array
2. 378. Kth Smallest Element in a Sorted Matrix
3. 973. K Closest Points to Origin
4. 23. Merge k Sorted Lists
5. 295. Find Median from Data Stream
6. Backtracking
• Permutations and Combinations
1. 46. Permutations
2. 47. Permutations II
3. 77. Combinations
4. 39. Combination Sum
5. 40. Combination Sum II
• Subsets
1. 78. Subsets
2. 90. Subsets II
3. 491. Increasing Subsequences
4. 784. Letter Case Permutation
5. 1286. Iterator for Combination
• Sudoku Solver
1. 37. Sudoku Solver
• N-Queens
1. 51. N-Queens
2. 52. N-Queens II
7. Greedy Algorithms
• Interval Scheduling
1. 435. Non-overlapping Intervals
2. 452. Minimum Number of Arrows to Burst Balloons
3. 763. Partition Labels
4. 646. Maximum Length of Pair Chain
5. 56. Merge Intervals
• Minimum Spanning Tree
1. 1584. Min Cost to Connect All Points
2. 1135. Connecting Cities With Minimum Cost
3. 1168. Optimize Water Distribution in a Village
4. 1102. Path With Maximum Minimum Value
5. 1514. Path with Maximum Probability
• Huffman Coding
1. 1094. Car Pooling
2. 451. Sort Characters By Frequency
3. 621. Task Scheduler
4. 767. Reorganize String
5. 1383. Maximum Performance of a Team
8. Bit Manipulation
• Basic Bit Operations
1. 136. Single Number
2. 191. Number of 1 Bits
3. 231. Power of Two
4. 190. Reverse Bits
5. 338. Counting Bits
• Bit Masks
1. 78. Subsets
2. 784. Letter Case Permutation
3. 131. Palindrome Partitioning
4. 401. Binary Watch
5. 693. Binary Number with Alternating Bits
• XOR Problems
1. 136. Single Number
2. 260. Single Number III
3. 137. Single Number II
4. 421. Maximum XOR of Two Numbers in an Array
5. 268. Missing Number
9. Stack and Queue
• Monotonic Stack
1. 84. Largest Rectangle in Histogram
2. 85. Maximal Rectangle
3. 739. Daily Temperatures
4. 496. Next Greater Element I
5. 503. Next Greater Element II
• Monotonic Queue
1. 239. Sliding Window Maximum
2. 862. Shortest Subarray with Sum at Least K
3. 1425. Constrained Subsequence Sum
4. 1696. Jump Game VI
5. 239. Sliding Window Maximum
• Queue-based BFS
1. 994. Rotting Oranges
2. 1091. Shortest Path in Binary Matrix
3. 1162. As Far from Land as Possible
4. 542. 01 Matrix
5. 1306. Jump Game III
10. Hashing
• Hash Map
1. 1. Two Sum
2. 3. Longest Substring Without Repeating Characters
3. 560. Subarray Sum Equals K
4. 128. Longest Consecutive Sequence
5. 49. Group Anagrams
• Hash Set
1. 217. Contains Duplicate
2. 219. Contains Duplicate II
3. 349. Intersection of Two Arrays
4. 202. Happy Number
5. 290. Word Pattern
• Trie
1. 208. Implement Trie (Prefix Tree)
2. 212. Word Search II
3. 648. Replace Words
4. 677. Map Sum Pairs
5. 211. Design Add and Search Words Data Structure
11. Advanced Data Structures
• Segment Tree
1. 307. Range Sum Query - Mutable
2. 308. Range Sum Query 2D - Mutable
3. 315. Count of Smaller Numbers After Self
4. 327. Count of Range Sum
5. 218. The Skyline Problem
• Fenwick Tree
1. 307. Range Sum Query - Mutable
2. 308. Range Sum Query 2D - Mutable
3. 315. Count of Smaller Numbers After Self
4. 493. Reverse Pairs
5. 1649. Create Sorted Array through Instructions
• Union-Find
1. 200. Number of Islands
2. 684. Redundant Connection
3. 721. Accounts Merge
4. 952. Largest Component Size by Common Factor
5. 990. Satisfiability of Equality Equations

You might also like