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/group-anagrams/
-
Length of Last word:
video: https://www.youtube.com/watch?v=KT9rltZTybQ&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=27 problem:
-
Search Insert Position
video: https://www.youtube.com/watch?v=K-RYzDZkzCI&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=23 problem:
-
-
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:
- video: https://www.youtube.com/watch?v=CFgUQUL7j_c
- problem:
- video: https://www.youtube.com/watch?v=CFgUQUL7j_c
-
Maximum Sub Array:
-
-
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:
-
#Recursion
1. Merge Two Sorted Lists
Problem: https://leetcode.com/problems/merge-two-sorted-lists/
Video: https://www.youtube.com/watch?v=XIdigk956u0
2. Reverse linked Lists
Problem: https://leetcode.com/problems/reverse-linked-list/
Video: https://www.youtube.com/watch?v=G0_I-ZF0S38
3. Power of two
Problem: https://leetcode.com/problems/power-of-two/
4. Power of three
Problem: https://leetcode.com/problems/power-of-three/
5. Power of four
Problem: https://leetcode.com/problems/power-of-four/
6. Swap nodes in pair
Problem: https://leetcode.com/problems/swap-nodes-in-pairs/
Video: https://www.youtube.com/watch?v=o811TZLAWOo
7. Pow(x, n)
Problem: https://leetcode.com/problems/powx-n/
Video: https://www.youtube.com/watch?v=g9YQyYi4IQQ&t=628s
8. Reorder List
Problem: https://leetcode.com/problems/reorder-list/
Video: https://www.youtube.com/watch?v=xRYPjDMSUFw
9. Remove Nodes From Linked List
Problem: https://leetcode.com/problems/remove-nodes-from-linked-list/
10. Add Two Numbers
Problem: https://leetcode.com/problems/add-two-numbers/
Video: https://www.youtube.com/watch?v=wgFPrzTjm7s&t=230s
- Bit Manipulation Reading: https://www.youtube.com/watch?v=7jkIUgLC29I