Data structures roadmap to solve 150+ leetcode problems in 5 weeks with a good understanding of basics and techniques
Some considerations while starting with problem-solving till 100+ Leetcode problems are solved:
- Start with the most-easiest problems.
- DO NOT try to solve each problem yourself, instead try to learn and understand how different problems are being solved
- Do not try to solve a problem for more than 1 hour initially to get fast and to achieve more in less time, for any problem taking more than 1 hour, put it in a backlog and solve it later
- Average time to solve a problem should be 30-45 minutes
- Do not try to solve a lot of problems from one topic, instead try to solve 5-10 problems per topic
- Do not try to jump into problem-solving directly without the necessary pre-requisites, For example
If you are trying to solve a problem that requires HashSet/HashMap then make sure you have studied HashMap before solving the problem If you are trying to solve a problem that uses recursion, first make sure you learn recursion properly If you are trying to solve a problem that uses graphs/trees, first make sure you learn graphs/tree properly If you are trying to solve a problem that uses dynamic programming, first make sure you learn dynamic programming properly.
-
Basic Understanding of Data structures in your language (C++ STL, C# Collections, Python Standard Library)
-
If you like C++ and more details > My code school Data Structures
https://www.youtube.com/playlist?list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P (C++)
-
If you like Python > code basics - Data Structures
https://www.youtube.com/playlist?list=PLeo1K3hjS3uu_n_a__MI_KktGTLYopZ12
-
Introduction to Hash Tables and Dictionaries by CS Dojo:
-
Easy String Algorithms
-
String as character arrays:
video: https://www.youtube.com/watch?v=TkTgo_7ab0M&pp=ygUQcHJpbnQgY2hhcmFjdGVycw%3D%3D
-
Count characters in string
-
-
Arrays & Hashing:_
-
Contains Duplicate
video: https://www.youtube.com/watch?v=3OamzN90kPg problem: https://leetcode.com/problems/contains-duplicate/
-
Valid Anagram:
video: https://www.youtube.com/watch?v=9UtInBqnCgA problem: https://leetcode.com/problems/valid-anagram
-
Two Sum:
video: https://www.youtube.com/watch?v=KLlXCFG5TnA problem: (https://leetcode.com/problems/two-sum/)
-
Length of Last word:
video: https://www.youtube.com/watch?v=KT9rltZTybQ&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=27 problem: https://leetcode.com/problems/length-of-last-word/
-
Search Insert Position
video: https://www.youtube.com/watch?v=K-RYzDZkzCI&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=23 problem: https://leetcode.com/problems/search-insert-position/
-
-
Two Pointers:_
-
Valid Palindrome
video: https://leetcode.com/problems/valid-palindrome/
problem: https://leetcode.com/problems/valid-palindrome/ -
Best time to buy and Sell Stock:
video: https://www.youtube.com/watch?v=1pkOgXD63yU&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=7&pp=iAQB problem: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
-
-
Stack & Queue Problems:_
-
Valid Parenthesis
video: https://www.youtube.com/watch?v=WTzjTskDFMg problem: https://leetcode.com/problems/valid-parentheses/
-
Implement Stack using Queue:
video: https://www.youtube.com/watch?v=rW4vm0-DLYc&list=PLot-Xpze53lfxD6l5pAGvCD4nPvWKU8Qo&index=10 problem: https://leetcode.com/problems/implement-stack-using-queues/
-
Implement Queue using Stack:
video: https://www.youtube.com/watch?v=3Et9MrMc02A&pp=ygUabmVldGNvZGUgcXVldWUgdXNpbmcgc3RhY2s%3D problem: https://leetcode.com/problems/implement-queue-using-stacks/
-
Sqrt(x)
problem: https://leetcode.com/problems/sqrtx/ video:
-
704 Binary Search
problem: https://leetcode.com/problems/binary-search/ video:
-
Count Negative Numbers in a Sorted Matrix
problem: https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix/ video:
-
Peak Index in a Mountain Array
- problem: https://leetcode.com/problems/peak-index-in-a-mountain-array/
- video:
-
Find Peak element:
-
Maximum Sub Array:
-
https://www.youtube.com/watch?v=IJDJ0kBx2LM
-
Linked List Course:_
course with problems (find all the similar problems on leetcode): video: https://www.youtube.com/watch?v=Hj_rA0dhr2I&pp=ygUXbGlua2VkbGlzdCBmcmVlY29kZWNhbXA%3D
-
Linked list problems:_
-
Reverse Linked List
https://leetcode.com/problems/reverse-linked-list/ https://www.youtube.com/watch?v=G0_I-ZF0S38
-
Merge 2 sorted Lits
https://leetcode.com/problems/merge-two-sorted-lists/ https://www.youtube.com/watch?v=XIdigk956u0
-
Linked List Cycle
https://leetcode.com/problems/linked-list-cycle/ https://www.youtube.com/watch?v=gBTe7lFR3vc
-
Reverse Linked List - Iterative AND Recursive
video: https://www.youtube.com/watch?v=G0_I-ZF0S38&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=10&pp=iAQB code: https://leetcode.com/problems/reverse-linked-list/
-
Palindrome Linked List
video: https://www.youtube.com/watch?v=yOzXms1J6Nk&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=13 problem:
-
Remove Linked List element:
video: https://www.youtube.com/watch?v=JI71sxtHTng&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=21&pp=iAQB problem:
-
1- Happy Number https://leetcode.com/problems/happy-number/
2- Isomorphic Strings https://leetcode.com/problems/isomorphic-strings/
3- Missing Number https://leetcode.com/problems/missing-number/
4- Word Pattern https://leetcode.com/problems/word-pattern/
5- Next Greater Element I https://leetcode.com/problems/next-greater-element-i/
https://www.youtube.com/watch?v=IJDJ0kBx2LM
Trees Full Course: https://www.youtube.com/watch?v=fAAZixBzIAI
https://www.youtube.com/watch?v=IJDJ0kBx2LM
Graphs Full Course:
https://www.youtube.com/watch?v=tWVWeAqZ0WU
1-Find the Town Judge
video: https://www.youtube.com/watch?v=ZUP_tIs4VaE
problem https://leetcode.com/problems/find-the-town-judge/
2- Find Center of Star Graph
video: https://www.youtube.com/watch?v=KEKcW6eLyEY
problem: https://leetcode.com/problems/find-center-of-star-graph/
3-Find if Path Exists in Graph
video: https://www.youtube.com/watch?v=QC4bDHEnmLM&pp=ygUfMTc5MS4gRmluZCBDZW50ZXIgb2YgU3RhciBHcmFwaA%3D%3D
problem: https://leetcode.com/problems/find-if-path-exists-in-graph/
1- Binary Tree Inorder Traversal
- video: https://youtu.be/g_S5WuasWUE
- problem: https://leetcode.com/problems/binary-tree-inorder-traversal
2- Binary Tree Preorder Traversal
- video: https://youtu.be/afTpieEZXck
- problem: https://leetcode.com/problems/binary-tree-preorder-traversal
3- Binary Tree Postorder Traversal
- video: https://youtu.be/QhszUQhGGlA
- problem: https://leetcode.com/problems/binary-tree-postorder-traversal
4- Validate Binary Search Tree
- video: https://youtu.be/s6ATEkipzow
- problem: https://leetcode.com/problems/validate-binary-search-tree
5- Path Sum
- video: https://youtu.be/LSKQyOz_P8I
- problem: https://leetcode.com/problems/path-sum
6- Pacific Atlantic Water Flow
- video: https://youtu.be/s-VkcjHqkGI
- problem: https://leetcode.com/problems/pacific-atlantic-water-flow
1- Binary Tree Level Order Traversal
- video: https://youtu.be/6ZnyEApgFYg
- problem: https://leetcode.com/problems/binary-tree-level-order-traversal
2- Maximum Depth of Binary Tree
3- Same Tree
- video: https://youtu.be/vRbbcKXCxOw
- problem: https://leetcode.com/problems/same-tree/
- video: https://youtu.be/tWVWeAqZ0WU
Dynamic Programming (DP) Full Course: https://www.youtube.com/watch?v=oBt53YbR9Kk&t=29s
-
Easy Problems:
-
Counting Bits: https://leetcode.com/problems/counting-bits/ Video: https://youtu.be/AgMr5uojxbM
-
Divisor Game: https://leetcode.com/problems/divisor-game/ Video: https://www.youtube.com/watch?v=UbE4-ONpJcc&ab_channel=Fraz
-
Climbing Stairs: https://leetcode.com/problems/climbing-stairs/ Video: https://youtu.be/UUaMrNOvSqg
-
Best Time to Buy and Sell Stock: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Video: https://youtu.be/excAOvwF_Wk
-
Min Cost Climbing Stairs: https://leetcode.com/problems/min-cost-climbing-stairs/ Video: https://youtu.be/8TDeGdY6qaM
-
Fibonacci Number: https://leetcode.com/problems/fibonacci-number/ Video: https://youtu.be/WvffCsh3Nt4
-
N-th Tribonacci Number: https://leetcode.com/problems/n-th-tribonacci-number/ Video: https://youtu.be/WvffCsh3Nt4
-
-
Medium Problems:
-
Word Break: https://leetcode.com/problems/word-break/ Video: https://youtu.be/_iIK7Gu7MNo
-
House Robber: https://leetcode.com/problems/house-robber/ Video: https://youtu.be/ZwDDLAeeBM0
-
Maximum Subarray: https://leetcode.com/problems/maximum-subarray/ Video: https://youtu.be/6HntYGZyjZI
-
- Divide & Conquer Algorithm: https://youtu.be/YOh6hBtX5l0
1- Majority Element
2- Maximum Subarray
3- Kth Large Element in an Array
- video: https://youtu.be/XEmy13g1Qxc
- problem: https://leetcode.com/problems/kth-largest-element-in-an-array
4- Sort an Array
- Top K Frequent Elements: https://leetcode.com/problems/top-k-frequent-elements
- Merge k Sorted Lists: https://leetcode.com/problems/merge-k-sorted-lists
1- Letter Combinations of a Phone Number
problem https://leetcode.com/problems/letter-combinations-of-a-phone-number/
video: https://www.youtube.com/watch?v=irkG33phXuw
2- The k-th Lexicographical String of All Happy Strings of Length n
problem https://leetcode.com/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/
video: https://www.youtube.com/watch?v=t3Hb0NYOA1c
- Bit Manipulation Reading: https://www.youtube.com/watch?v=7jkIUgLC29I