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

DSA LeetCode Pattern Roadmap

The document outlines a comprehensive roadmap for mastering Data Structures and Algorithms (DSA) through various patterns, including Array + Hashing, Two Pointers, Sliding Window, and more. Each section lists key questions and problems to solve, providing a structured approach to learning. Additionally, it includes golden rules for pattern recognition to aid in problem-solving.
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)
5 views5 pages

DSA LeetCode Pattern Roadmap

The document outlines a comprehensive roadmap for mastering Data Structures and Algorithms (DSA) through various patterns, including Array + Hashing, Two Pointers, Sliding Window, and more. Each section lists key questions and problems to solve, providing a structured approach to learning. Additionally, it includes golden rules for pattern recognition to aid in problem-solving.
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

Complete DSA + LeetCode Pattern Roadmap

1. Array + Hashing
# Question

1 Two Sum
2 Contains Duplicate
3 Valid Anagram
4 Group Anagrams
5 Top K Frequent Elements
6 Product of Array Except Self
7 Longest Consecutive Sequence
8 Encode and Decode Strings
9 Majority Element
10 Find All Numbers Disappeared in an Array

2. Two Pointers
# Question

1 Valid Palindrome
2 Two Sum II
3 Merge Sorted Array
4 Remove Duplicates from Sorted Array
5 Move Zeroes
6 Container With Most Water
7 3Sum
8 4Sum
9 Trapping Rain Water
10 Squares of a Sorted Array

3. Sliding Window
# Question

1 Best Time to Buy and Sell Stock


2 Longest Substring Without Repeating Characters
3 Longest Repeating Character Replacement
4 Permutation in String
5 Minimum Size Subarray Sum
6 Maximum Average Subarray I
7 Sliding Window Maximum
8 Minimum Window Substring
9 Fruit Into Baskets
10 Binary Subarrays With Sum

4. Prefix Sum
# Question

1 Range Sum Query


2 Running Sum of 1D Array
3 Find Pivot Index
4 Subarray Sum Equals K
5 Continuous Subarray Sum
6 Product of Array Except Self
7 Maximum Size Subarray Sum Equals k
8 Contiguous Array
9 Corporate Flight Bookings
10 Car Pooling

5. Binary Search
# Question

1 Binary Search
2 Search Insert Position
3 First Bad Version
4 Search in Rotated Sorted Array
5 Find Minimum in Rotated Sorted Array
6 Find Peak Element
7 Koko Eating Bananas
8 Capacity To Ship Packages Within D Days
9 Median of Two Sorted Arrays
10 Time Based Key-Value Store
6. Sorting
# Question

1 Sort Colors
2 Merge Intervals
3 Insert Interval
4 Non-overlapping Intervals
5 Meeting Rooms
6 Largest Number
7 Sort Characters By Frequency
8 Queue Reconstruction by Height
9 Minimum Number of Arrows to Burst Balloons
10 Car Fleet

7. Linked List
# Question

1 Reverse Linked List


2 Linked List Cycle
3 Middle of Linked List
4 Merge Two Sorted Lists
5 Remove Nth Node From End
6 Palindrome Linked List
7 Reorder List
8 Add Two Numbers
9 Copy List with Random Pointer
10 LRU Cache

8. Stack
# Question

1 Valid Parentheses
2 Min Stack
3 Evaluate Reverse Polish Notation
4 Daily Temperatures
5 Next Greater Element I
6 Largest Rectangle in Histogram
7 Basic Calculator
8 Asteroid Collision
9 Remove K Digits
10 Decode String

9. Queue + BFS
# Question

1 Implement Stack using Queues


2 Number of Recent Calls
3 Rotting Oranges
4 Binary Tree Level Order Traversal
5 Open the Lock
6 Walls and Gates
7 Perfect Squares
8 Word Ladder
9 01 Matrix
10 Shortest Path in Binary Matrix

10. Tree DFS


# Question

1 Maximum Depth of Binary Tree


2 Same Tree
3 Invert Binary Tree
4 Balanced Binary Tree
5 Diameter of Binary Tree
6 Path Sum
7 Binary Tree Maximum Path Sum
8 Subtree of Another Tree
9 Lowest Common Ancestor
10 Construct Binary Tree from Preorder and Inorder Traversal
Golden Rules for Pattern Recognition
• Subarray / Substring → Sliding Window
• Sorted Array → Two Pointers / Binary Search
• Fast Lookup → HashMap / Set
• All Possibilities → Backtracking
• Dependency Order → Graph / Topological Sort
• Repeated Choices → Dynamic Programming

You might also like