- **Introduction:** - 8 important patterns for coding interviews split into two categories: - **Linear structures:** arrays, linked lists, strings. - **Nonlinear structures:** trees, graphs. - Focus on pre-built code templates for these patterns. - **Linear Data Structure Patterns:** 1. **Two Pointers:** - Reduces time complexity to linear time \(O(n)\). - Two methods: - Same direction: used for scanning data in a single pass (e.g., fast and slow pointers to detect cycles or find middle elements). - Opposite directions: used for finding pairs (e.g., sum of two numbers in a sorted array). 2. **Sliding Window:** - Refines two pointers to manage a window of elements dynamically. - Expands or contracts the window to meet specific conditions (e.g., longest substring without repeating characters). - Often combined with hashmaps. 3. **Binary Search:** - Efficiently finds target in logarithmic time \(O(\log n)\). - Extends to lists with monotonic conditions, not just sorted numbers. - Example: finding the minimum in a rotated sorted array. - **Nonlinear Data Structure Patterns:** 4. **Breadth-First Search (BFS):** - Explores nodes level by level. - Uses a queue to keep track of visited nodes (ideal for level order traversal). 5. **Depth-First Search (DFS):** - Dives deep into one path before exploring others. - Often uses recursion and is memory efficient for exploring all paths. - Example: counting islands in a grid. 6. **Backtracking:** - Extension of DFS, explores all possible solutions. - Builds the solution dynamically by making decisions and backtracking on invalid paths. - Example: letter combinations of a phone number. - **Heaps (Priority Queue):** 7. **Heaps:** - Used for questions related to top K, K smallest/largest. - **Min Heap:** smallest value at the root. - **Max Heap:** largest value at the root. - Max Heap is used to find K smallest values, and vice versa for K largest. - **Dynamic Programming (DP):** 8. **Dynamic Programming:** - Optimizes solutions by breaking problems into overlapping subproblems. - Two approaches: - **Top-down:** recursive with memoization to store results. - **Bottom-up:** solves smaller subproblems iteratively using a table. - Too complex for this video but covered in-depth on their website.
@xEveNxThExOdds2 ай бұрын
one of the best videos on the topic i’ve seen, thank you
@ytrg122 күн бұрын
Excellent! Thank you so much for this video. All of the data structures can be overwhelming to remember, you breaking them down into categories, with their use cases, and providing templates was so useful.
@sahiljain5979Ай бұрын
thanks a lot man. never thought of solving leetcode as templates .this is really helpful.
@stanrobertson2 ай бұрын
Thanks for the update, Anna! It is great that you are sharing your experience so that others can have hope.
@KushLemonАй бұрын
Wtf are you blabbering about?
@nathsai1658Ай бұрын
Absolutely loved this video! Thanks a lot!
@manishmahajan6094Ай бұрын
wow ! this gave so much clarity
@skazahay3 күн бұрын
17:54: Does this only apply to solutions where you limit the max size of the heap to k? Couldn’t you use a full-size minHeap, then pop k elements to get the same result of the k smallest numbers? I’m assuming there’s a reasoning behind it that I’m missing. Thank you for the content, this has been very helpful in studying.
@iamsaranhereКүн бұрын
Best if the best like 3b1b in Math ,your animations is in whole other league bro for dsa
@sushibot122 ай бұрын
Thanks for making this.
@PranavRPiseАй бұрын
This is what I was looking for!
@Aman-xo4yx2 ай бұрын
Very helpful bro!
@ricardosilva3482Ай бұрын
Regarding Binary Search for the "Find Minimum in Rotated Sorted Array" problem, I'm a bit unsure if the boolean array approach works. For example, if we have the rotated array of [50, 60, 70, 80, 90, 10, 20, 30, 40], wouldn't the approach return 20 instead of 10?
@brandonbraner23 күн бұрын
well this video worked, just signed up for the black Friday special :)
@ivmmosАй бұрын
Much appreciation from self-learner!👍
@existentialism_0113 күн бұрын
hey man, am self-learner aswell, wanna collaborate?
@jaskiratsood1643Ай бұрын
Thank you so much.
@pravinprince32212 ай бұрын
Thank you so much sir for the wonderful video
@Salah-YT2 ай бұрын
thank u so much
@Website_TV_12 ай бұрын
Struggling with LeetCode? Not anymore! 🚀 These 8 patterns and templates are game-changers for tackling even the toughest problems! 🤯 I wish I learned these earlier - it would have saved me HOURS of frustration. If you're aiming to ace your coding interviews, this video is a MUST-WATCH! 🧑💻✨ ⚡ Pro tip: Stick around till the end for an epic bonus! 💡 time stamp: 0:00 - Intro 0:49 - Two Pointers 2:29 - Sliding Window 4:20 - Binary Search 7:34 - BFS 10:08 - DFS 13:08 - Backtracking 16:58 - Priority Queue (Heap) 19:01 - Dynamic Programming
@Apollon609Ай бұрын
what the fudge are you saying at 9:16
@IceGamerification2 ай бұрын
where do i check this stuff out again?
@algo.monster2 ай бұрын
algo.monster/
@rohan6372 ай бұрын
Unable to buy your course from India. It say "Merchant is non-compliant with RBI guidelines for recurring payments and e-mandate". And yes I have international payments on on my card
@algo.monster2 ай бұрын
Hey Rohan, thanks so much for letting us know. Which bank are you using? There is an issue with subscription in India since we are a foreign entity. Could you send us an email at support@algo.monster and we can look into it.
@PanicAtProduction2 ай бұрын
Awesome!
@algo.monster2 ай бұрын
Thank you! Cheers!
@aliadel17232 ай бұрын
Best Platform
@robbyoconnor19 күн бұрын
16:38 The background music is a huge mistake... it's very relaxing
@nadeem-cp9is2 ай бұрын
great video
@kayalvizhi36242 ай бұрын
Is any one tell me.. Learning dsa is useful for careee or not?
@algo.monster2 ай бұрын
It's probably the single highest return-on-investment activity you could do for a tech career, opens so many doors once we you master it
@chandantalreja082 ай бұрын
Thank you so much
@kishorpustake668219 сағат бұрын
I can't think logic of an easy leetcode problems can't solve a single easy leetcode problem till now from 2 years I m learning 😖😖😖
@nishantsharma88242 ай бұрын
but there are no jobs what would i do after learning all this?
@datastatacian2 ай бұрын
yes. learning for fun.
@algo.monster2 ай бұрын
I hear you-things are tough right now, but the pendulum always swings in both directions. The tech industry (like any other industry) has its ups and downs, but it always picks back up. By building your skills now, you'll be ready to seize opportunities when the market improves. Watch this video on this topic: kzbin.info/www/bejne/b3LJppuknc5kgLM
@ritik42932 ай бұрын
This content was never about learning or memorizing things just for getting jobs , it's something that if you truly understand and are curious about can help you solve problems that can help you create your own company...!
@TheSwden2 ай бұрын
This is like multi level preaching. You can teach others and they can teach others and they can teach others....
@TheSwden2 ай бұрын
@@ritik4293kya bhai.. Kuch b
@roushanv2 ай бұрын
Absolutely, i just don't remember how many times i have been asked binary search like finding indices of the numbers repeated in a sorted array 😂
@AmitNayekamit006Ай бұрын
In `DFS` function 16:07 path.pop() never execute.
@mobiledevelopmentmastery2024Ай бұрын
Could you share some discount for your subscription?
@GauravSrivastava-c5q27 күн бұрын
dont know why but feel little bit of confident by seeing some medium level could be solved by patterns
@TheGIQ123Ай бұрын
For the TF question (binary search) you forgot to stipulate that the input only has false, then true (can’t do TFTF) Also, the vocal AI had a hiccup at the 9m mark lmao
@algo.monsterАй бұрын
input has to be monotonic, which mens F(0) cannot go after T(1)
@ml_serenity2 ай бұрын
Leetcode has nothing to do with the real-world programming in 99% of cases.
@rickyc46Ай бұрын
Wrong
@ml_serenityАй бұрын
@rickyc46 tell me more about it.
@aakashsrivastava5557Ай бұрын
Please wake up
@melophylic746923 күн бұрын
I mean when you need to build scalable applications it will be used. Relational databases, pathfinding algorithms, making filters, recommendation algorithms, etc. But non-scalable ones don't really need them ig.
@ml_serenity22 күн бұрын
@@melophylic7469 Inventing algorithms? Cool. Most of us professional programmers don't ever do that stuff.
@omai2258 күн бұрын
This video is very misleading. Important information is left out and some of the examples used don’t really demonstrate the full use of the patterns. The template code is also very clunky. It almost seems like the person narrating the video hasn’t grinded any Leetcode problems before. Is this what you can expect of algomonster?