- **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.
@xEveNxThExOdds3 ай бұрын
one of the best videos on the topic i’ve seen, thank you
@eager_learner4 күн бұрын
Very Insightful!! Explained very well, got clear basics of each pattern.
@stanrobertson3 ай бұрын
Thanks for the update, Anna! It is great that you are sharing your experience so that others can have hope.
@KushLemon2 ай бұрын
Wtf are you blabbering about?
@ytrg1Ай бұрын
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.
@sahiljain59792 ай бұрын
thanks a lot man. never thought of solving leetcode as templates .this is really helpful.
@nathsai16582 ай бұрын
Absolutely loved this video! Thanks a lot!
@manishmahajan60942 ай бұрын
wow ! this gave so much clarity
@Website_TV_13 ай бұрын
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
@sushibot123 ай бұрын
Thanks for making this.
@iamsaranhereАй бұрын
Best if the best like 3b1b in Math ,your animations is in whole other league bro for dsa
@PranavRPise2 ай бұрын
This is what I was looking for!
@Aman-xo4yx3 ай бұрын
Very helpful bro!
@brandonbranerАй бұрын
well this video worked, just signed up for the black Friday special :)
@skazahayАй бұрын
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.
@yaphetsgg493428 күн бұрын
Even I thought of your approach initially but I think it is done this way to save memory and for faster insert & remove operations - O(log k) instead of O(log n), given k < n always. So, for very large values of n and a small value for k, this approach would save significantly on both space and time.
@ricardosilva34822 ай бұрын
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?
@unomas-jo7ou7 күн бұрын
Great content
@jaskiratsood16432 ай бұрын
Thank you so much.
@Salah-YT3 ай бұрын
thank u so much
@pravinprince32213 ай бұрын
Thank you so much sir for the wonderful video
@ColeHartman125 күн бұрын
Great summary, although the templates are a bit convoluted to me. It should be made easier to visualize at first glance.
@ivmmos2 ай бұрын
Much appreciation from self-learner!👍
@existentialism_01Ай бұрын
hey man, am self-learner aswell, wanna collaborate?
@SkandiaAUS26 күн бұрын
This is an AI generated voice. It's actually not terrible, and I've seen other videos on this channel and you do know what you're talking about. So why did you decide to go with the generated voice, instead of your own?
@robbyoconnorАй бұрын
16:38 The background music is a huge mistake... it's very relaxing
@debojitmandal867010 күн бұрын
Hi how much do I need for a data science interview in product based companies
@PanicAtProduction3 ай бұрын
Awesome!
@algo.monster3 ай бұрын
Thank you! Cheers!
@rohan6373 ай бұрын
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.monster3 ай бұрын
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.
@nadeem-cp9is3 ай бұрын
great video
@aliadel17233 ай бұрын
Best Platform
@Apollon6092 ай бұрын
what the fudge are you saying at 9:16
@anandtheertha27757 күн бұрын
😂
@gesuchter7 күн бұрын
AI speech?
@IceGamerification3 ай бұрын
where do i check this stuff out again?
@algo.monster3 ай бұрын
algo.monster/
@chandantalreja083 ай бұрын
Thank you so much
@roushanv3 ай бұрын
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 😂
@GauravSrivastava-c5qАй бұрын
dont know why but feel little bit of confident by seeing some medium level could be solved by patterns
@kishorpustake6682Ай бұрын
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 😖😖😖
@kayalvizhi36243 ай бұрын
Is any one tell me.. Learning dsa is useful for careee or not?
@algo.monster3 ай бұрын
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
@AmitNayekamit0062 ай бұрын
In `DFS` function 16:07 path.pop() never execute.
@mobiledevelopmentmastery20242 ай бұрын
Could you share some discount for your subscription?
@TheGIQ1232 ай бұрын
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.monster2 ай бұрын
input has to be monotonic, which mens F(0) cannot go after T(1)
@nishantsharma88243 ай бұрын
but there are no jobs what would i do after learning all this?
@kiprutos3 ай бұрын
yes. learning for fun.
@algo.monster3 ай бұрын
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
@ritik42933 ай бұрын
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...!
@TheSwden3 ай бұрын
This is like multi level preaching. You can teach others and they can teach others and they can teach others....
@TheSwden3 ай бұрын
@@ritik4293kya bhai.. Kuch b
@techenthusiast-q9nКүн бұрын
It feels a little irritating when you are introducing 'algo monster' after each pattern. Having it at the start and then at the end, makes more suitable
@omai225Ай бұрын
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?
@crockz0rАй бұрын
it's a 20 minutes video, what would you expect?
@omai225Ай бұрын
@ does it being 20 mins change what I said?
@ml_serenity3 ай бұрын
Leetcode has nothing to do with the real-world programming in 99% of cases.
@rickyc462 ай бұрын
Wrong
@ml_serenity2 ай бұрын
@rickyc46 tell me more about it.
@aakashsrivastava55572 ай бұрын
Please wake up
@melophylic7469Ай бұрын
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_serenityАй бұрын
@@melophylic7469 Inventing algorithms? Cool. Most of us professional programmers don't ever do that stuff.