Original resource By (https://github.com/ZeeshanAdilButt/Data-Structures-RoadMap/blob/main/README.md)
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
- The 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:
https://www.youtube.com/watch?v=sfWyugl4JWA
- Easy String Algorithms
- String as character arrays:
video: https://www.youtube.com/watch?v=TkTgo_7ab0M&pp=ygUQcHJpbnQgY2hhcmFjdGVycw%3D%3D
- Count characters in string
video: https://www.youtube.com/watch?v=kWr0TIjO6nU
- 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:
- Search Insert Position
video: https://www.youtube.com/watch?v=K-RYzDZkzCI&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=23 problem:
- Two Pointers:_
V- alid 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/
S- tack & Queue Problems:_
- alid 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: Maximum Sub Array:
video: https://www.youtube.com/watch?v=5WZl3MMT0Eg&list=PLot-Xpze53lfQmTEztbgdp8ALEoydvnRQ&index=4 problem: https://leetcode.com/problems/maximum-subarray/ Recursion Course ( don't watch the trees or graphs section): 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:
Hash table 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/
Trees Recursion Course (watch the trees section): https://www.youtube.com/watch?v=IJDJ0kBx2LM
Trees Full Course: https://www.youtube.com/watch?v=fAAZixBzIAI
Graphs Recursion Course ( watch the graphs section): 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/
DFS 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 BFS 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
video: https://youtu.be/hTM3phVI6YQ problem: https://leetcode.com/tag/breadth-first-search/ 3- Same Tree
video: https://youtu.be/vRbbcKXCxOw problem: https://leetcode.com/problems/same-tree/ Graph Algorithm for Technical Interview video: https://youtu.be/tWVWeAqZ0WU
Dynamic Programming (DP): 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
simple trick backtracking is DP which undoes its operation if it doesn't find the answer: 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
++++++++++++++++++++++++++++++++++++++++++ Some more nice problems (to be updated): Best Time to Buy and Sell Stock
First Bad Version
Isomorphic Strings
Two Sum
Squares of a Sorted Array
Merge Two Sorted Lists
Is Subsequence
Two Sum II - Input Array Is Sorted
Rotate Array
Reverse Linked List
Search Insert Position
Some good resources (to be updated): Bit Manipulation Reading: https://www.youtube.com/watch?v=7jkIUgLC29I
- Love Babbar: Follow Love Babbar's YouTube channel for insightful explanations and problem-solving techniques.
- Fraz: Explore Fraz's YouTube content for in-depth discussions on programming and algorithms.
- LeetCode: Sharpen your coding skills and tackle algorithmic challenges.
- GeeksforGeeks: Access a wide range of data structures and algorithms problems with detailed explanations.
- Code Ninja: Engage in coding challenges and competitions to enhance your problem-solving skills.
- C++ Programming from Problem Analysis to Program Design: This book is an excellent resource for mastering C++ concepts, problem analysis, and program design.
- Codeforces: Participate in competitive programming contests and improve your algorithmic skills.
- HackerRank: Solve coding challenges and enhance your proficiency in various domains.
- C++ Basics: Variables, loops, conditionals, functions, and basic syntax.
- Arrays: Manipulation, searching, and sorting algorithms.
- Linked Lists: Singly linked lists, doubly linked lists, and circular linked lists.
- Stacks and Queues: Implementation and real-world applications.
- Trees: Binary trees, binary search trees, and tree traversal algorithms.
- Graphs: Representation, traversal, and common algorithms (DFS, BFS).
- Sorting Algorithms: Bubble sort, selection sort, merge sort, quicksort.
- Searching Algorithms: Binary search, linear search.
- Dynamic Programming: Solving optimization problems using dynamic programming.
- Hashing: Hash functions, collision resolution, and applications.
- Greedy Algorithms: Problem-solving using the greedy approach.
- Bit Manipulation: Operations, counting set bits, and bitwise XOR.
- Recursion: Understanding and implementing recursive solutions.
Feel free to combine insights from these resources for a well-rounded learning experience. If you're contributing to this repository, consider sharing your solutions or insights gained from these resources to benefit the community.