0% found this document useful (0 votes)
51 views5 pages

31 DSA Patterns LeetCode

The document lists 31 data structure and algorithm patterns along with corresponding LeetCode problems for each pattern. Patterns include Sliding Window, Two Pointers, Fast & Slow Pointers, Merge Intervals, and more, with links to specific problems provided. This serves as a comprehensive guide for practicing various algorithmic techniques.
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)
51 views5 pages

31 DSA Patterns LeetCode

The document lists 31 data structure and algorithm patterns along with corresponding LeetCode problems for each pattern. Patterns include Sliding Window, Two Pointers, Fast & Slow Pointers, Merge Intervals, and more, with links to specific problems provided. This serves as a comprehensive guide for practicing various algorithmic techniques.
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/ 5

31 DSA Patterns with LeetCode Problems

Sliding Window
- 3. Longest Substring Without Repeating Characters:

https://leetcode.com/problems/longest-substring-without-repeating-characters/

- 567. Permutation in String: https://leetcode.com/problems/permutation-in-string/

- 76. Minimum Window Substring: https://leetcode.com/problems/minimum-window-substring/

- 239. Sliding Window Maximum: https://leetcode.com/problems/sliding-window-maximum/

Two Pointers
- 167. Two Sum II - Input Array is Sorted: https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/

- 15. 3Sum: https://leetcode.com/problems/3sum/

- 11. Container With Most Water: https://leetcode.com/problems/container-with-most-water/

- 26. Remove Duplicates from Sorted Array:

https://leetcode.com/problems/remove-duplicates-from-sorted-array/

Fast & Slow Pointers


- 141. Linked List Cycle: https://leetcode.com/problems/linked-list-cycle/

- 142. Linked List Cycle II: https://leetcode.com/problems/linked-list-cycle-ii/

- 876. Middle of the Linked List: https://leetcode.com/problems/middle-of-the-linked-list/

- 202. Happy Number: https://leetcode.com/problems/happy-number/

Merge Intervals
- 56. Merge Intervals: https://leetcode.com/problems/merge-intervals/

- 57. Insert Interval: https://leetcode.com/problems/insert-interval/

- 252. Meeting Rooms: https://leetcode.com/problems/meeting-rooms/

- 253. Meeting Rooms II: https://leetcode.com/problems/meeting-rooms-ii/

Binary Search
- 704. Binary Search: https://leetcode.com/problems/binary-search/

- 33. Search in Rotated Sorted Array: https://leetcode.com/problems/search-in-rotated-sorted-array/

- 153. Find Minimum in Rotated Sorted Array:

https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/

- 4. Median of Two Sorted Arrays: https://leetcode.com/problems/median-of-two-sorted-arrays/


Prefix Sum
- 560. Subarray Sum Equals K: https://leetcode.com/problems/subarray-sum-equals-k/

- 303. Range Sum Query - Immutable: https://leetcode.com/problems/range-sum-query-immutable/

- 724. Find Pivot Index: https://leetcode.com/problems/find-pivot-index/

- 437. Path Sum III: https://leetcode.com/problems/path-sum-iii/

Dynamic Programming (1D)


- 70. Climbing Stairs: https://leetcode.com/problems/climbing-stairs/

- 198. House Robber: https://leetcode.com/problems/house-robber/

- 746. Min Cost Climbing Stairs: https://leetcode.com/problems/min-cost-climbing-stairs/

- 213. House Robber II: https://leetcode.com/problems/house-robber-ii/

Dynamic Programming (2D)


- 62. Unique Paths: https://leetcode.com/problems/unique-paths/

- 64. Minimum Path Sum: https://leetcode.com/problems/minimum-path-sum/

- 1143. Longest Common Subsequence: https://leetcode.com/problems/longest-common-subsequence/

- 72. Edit Distance: https://leetcode.com/problems/edit-distance/

Topological Sort
- 207. Course Schedule: https://leetcode.com/problems/course-schedule/

- 210. Course Schedule II: https://leetcode.com/problems/course-schedule-ii/

- 269. Alien Dictionary: https://leetcode.com/problems/alien-dictionary/

Breadth-First Search (BFS)


- 102. Binary Tree Level Order Traversal: https://leetcode.com/problems/binary-tree-level-order-traversal/

- 994. Rotting Oranges: https://leetcode.com/problems/rotting-oranges/

- 127. Word Ladder: https://leetcode.com/problems/word-ladder/

Depth-First Search (DFS)


- 200. Number of Islands: https://leetcode.com/problems/number-of-islands/

- 695. Max Area of Island: https://leetcode.com/problems/max-area-of-island/

- 130. Surrounded Regions: https://leetcode.com/problems/surrounded-regions/

Linked List Manipulation


- 206. Reverse Linked List: https://leetcode.com/problems/reverse-linked-list/
- 21. Merge Two Sorted Lists: https://leetcode.com/problems/merge-two-sorted-lists/

- 2. Add Two Numbers: https://leetcode.com/problems/add-two-numbers/

Union-Find
- 547. Number of Provinces: https://leetcode.com/problems/number-of-provinces/

- 684. Redundant Connection: https://leetcode.com/problems/redundant-connection/

- 1202. Smallest String With Swaps: https://leetcode.com/problems/smallest-string-with-swaps/

Backtracking
- 46. Permutations: https://leetcode.com/problems/permutations/

- 39. Combination Sum: https://leetcode.com/problems/combination-sum/

- 37. Sudoku Solver: https://leetcode.com/problems/sudoku-solver/

Kadanes Algorithm
- 53. Maximum Subarray: https://leetcode.com/problems/maximum-subarray/

- 918. Maximum Sum Circular Subarray: https://leetcode.com/problems/maximum-sum-circular-subarray/

Monotonic Stack
- 739. Daily Temperatures: https://leetcode.com/problems/daily-temperatures/

- 84. Largest Rectangle in Histogram: https://leetcode.com/problems/largest-rectangle-in-histogram/

Trie
- 208. Implement Trie (Prefix Tree): https://leetcode.com/problems/implement-trie-prefix-tree/

- 212. Word Search II: https://leetcode.com/problems/word-search-ii/

Heap / Priority Queue


- 215. Kth Largest Element in an Array: https://leetcode.com/problems/kth-largest-element-in-an-array/

- 347. Top K Frequent Elements: https://leetcode.com/problems/top-k-frequent-elements/

Bit Manipulation
- 136. Single Number: https://leetcode.com/problems/single-number/

- 191. Number of 1 Bits: https://leetcode.com/problems/number-of-1-bits/

Matrix Traversal
- 54. Spiral Matrix: https://leetcode.com/problems/spiral-matrix/
- 733. Flood Fill: https://leetcode.com/problems/flood-fill/

Counting Patterns
- 49. Group Anagrams: https://leetcode.com/problems/group-anagrams/

- 1207. Unique Number of Occurrences: https://leetcode.com/problems/unique-number-of-occurrences/

Bucket/Counting Sort
- 75. Sort Colors: https://leetcode.com/problems/sort-colors/

- 451. Sort Characters by Frequency: https://leetcode.com/problems/sort-characters-by-frequency/

Recursion Trees
- 78. Subsets: https://leetcode.com/problems/subsets/

- 90. Subsets II: https://leetcode.com/problems/subsets-ii/

Stack + Queue Hybrid


- 232. Implement Queue using Stacks: https://leetcode.com/problems/implement-queue-using-stacks/

- 225. Implement Stack using Queues: https://leetcode.com/problems/implement-stack-using-queues/

Graph with Weights


- 743. Network Delay Time: https://leetcode.com/problems/network-delay-time/

- 787. Cheapest Flights Within K Stops: https://leetcode.com/problems/cheapest-flights-within-k-stops/

Matrix DP
- 64. Minimum Path Sum: https://leetcode.com/problems/minimum-path-sum/

- 322. Coin Change: https://leetcode.com/problems/coin-change/

Pattern Matching
- 28. Find the Index of the First Occurrence in a String:

https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/

- 10. Regular Expression Matching: https://leetcode.com/problems/regular-expression-matching/

Segment Trees
- 307. Range Sum Query - Mutable: https://leetcode.com/problems/range-sum-query-mutable/

Sliding Window + Hashing


- 438. Find All Anagrams in a String: https://leetcode.com/problems/find-all-anagrams-in-a-string/

In-place Transformations
- 48. Rotate Image: https://leetcode.com/problems/rotate-image/

- 283. Move Zeroes: https://leetcode.com/problems/move-zeroes/

Knapsack
- 416. Partition Equal Subset Sum: https://leetcode.com/problems/partition-equal-subset-sum/

- 474. Ones and Zeroes: https://leetcode.com/problems/ones-and-zeroes/

- 518. Coin Change II: https://leetcode.com/problems/coin-change-ii/

You might also like