- 2
- 230 424
DecodingIntuition
เข้าร่วมเมื่อ 16 ก.ค. 2024
Explaining the algorithms for writing algorithms
Dynamic Programming: 3 consistent steps from recursive to iterative
If you can do it recursively, you can do it iteratively. I'll show you 3 steps to convert any recursive dynamic programming solution into an iterative one: defining bounds, managing dependencies, and replacing recursive calls with values!
If you haven't watched my first video on dynamic programming, go watch that first: th-cam.com/video/gK8KmTDtX8E/w-d-xo.html.
If you haven't watched my first video on dynamic programming, go watch that first: th-cam.com/video/gK8KmTDtX8E/w-d-xo.html.
มุมมอง: 18 678
วีดีโอ
Dynamic Programming isn't too hard. You just don't know what it is.
มุมมอง 212K4 หลายเดือนก่อน
#dynamicprogramming #leetcode
how are u moving around the text so fast 9:48
I felt the goosebumps I feel when I solve math questions during school. Mannn its crazy and you sparked the new way to look at problems. I cant explain in words how much satisfied I feel right now. God bless all the fortune to you.
0:44 totally agree.. DP is just misunderstood XD
I'm a pretty smart guy and I've been self teaching myself multiple coding languages for years now. This video made me feel retarded. Can someone explain to me wtf a Cache Complexity is? The phrasing in some parts of the video has me lost entirely, even if the actual solution makes sense.
Don't get me wrong though. I love the video! Amazing quality and is very informative.
tried breaking down the question into smaller parts, didnt work ( different questions btw) , after 1hr 37 mins i got exhausted and looked for the solution, do you think this is bad practice ?
2:16 Dude turned up about dp lol
14:56 moistcr1tikal
oh, so THATS how you do problem solving! i aways do this on my head, turns out i WAS doing something wrong.
I want to create a simple 2D Game Engine with Integrated Development Environment (IDE) in C++ But to develop this Big Project, it needs strong Math and that's where I would start learning to be a software engineer. Linear Algebra - makes it easier to understand 3D Graphics. Discrete Math - makes it easier to understand algorithm development. I'd start with Math.
17:50 isn’t it (n+1)*(amount+1) since both include 0 in counting?
Based channel name
okay but what if im not using python and dont have the magic @cache to save my results?
Really nice video! I agree with your approach to solving these. You break things down really well and do a good job explaining your thought. Thanks!
Legit the chadest video I've seen on this topic.
What is funny is that if you understand soo much complexity eventually you making a refactor making o(n ^ 2) to O(n) willl not be valuabled as the professional who do O(n ^ 2) but he does it faster.
The dirties, most filthy approach in all of programming…
this video confused me even more. i hope one day it makes sense to me
Dude, you changed my programming life
why is cached complexity O(n) for catalan?
best explanation of DP i've ever seen, love the idea of not relying on tables
Please return this is the best series on programming problem solving I've seen 😢
witchcraft
We'd worship you , if you keep uploading man
Keep uploading please
Wish you finished the thought you had at 15:52. What were you going to do to fix your naive recursion?
You are DP GOD🙏 It's all math down the root. So clear. I'll rewatch this multiple times. THIS is TRUE problem solving.
Commenting for the algorithm, thanks man
I see wisdom and clarity. Thank you.
this is the greatest educational video ive ever seen on this entire platform
holy fuck this video is awesome
honestly completely ignoring what this video is about and the dynamic programming part, you should make a shorter video just going over how you analyze and write out the different parts to figure out exactly what your trying to solve. ima start doing this for every leetcode problem, and honestly any recruiter would probably be shocked and impressed if you did all this during an interview
You are a goddamn machine. I'm in awe. The way you knew it would pass even before running it? I'm so deeply impressed.
Damn, that is beautiful reasoning right there!
the right image is related to tabulation. what's the left image related to?
Repeat with me: recursion can't be faster than procedural
Thank you
I hate cache and that's all the reason i need to skip learning dp
20:17 re: Richard Bellman “I spent the Fall quarter (of 1950) at RAND. My first task was to find a name for multistage decision processes. “An interesting question is, ‘Where did the name, dynamic programming, come from?’ The 1950s were not good years for mathematical research. We had a very inter- esting gentleman in Washington named Wilson. He was Secretary of Defense, and he actually had a pathological fear and hatred of the word, research. I’m not using the term lightly; I’m using it precisely. His face would suffuse, he would turn red, and he would get violent if people used the term, research, in his presence. You can imagine how he felt, then, about the term, mathematical. The RAND Cor- poration was employed by the Air Force, and the Air Force had Wilson as its boss, essentially. Hence, I felt I had to do something to shield Wilson and the Air Force from the fact that I was really doing mathematics inside the RAND Cor- poration. What title, what name, could I choose? In the first place I was interested in planning, in decision making, in thinking. But planning, is not a good word for various rea- sons. I decided therefore to use the word, ‘programming.’ I wanted to get across the idea that this was dynamic, this was multistage, this was time-varying-I thought, let’s kill two birds with one stone. Let’s take a word that has an absolutely precise meaning, namely dynamic, in the clas- sical physical sense. It also has a very interesting property as an adjective, and that is it’s impossible to use the word, dynamic, in a pejorative sense. Try thinking of some com- bination that will possibly give it a pejorative meaning. It’s impossible. Thus, I thought dynamic programming was a good name. It was something not even a Congressman could object to. So I used it as an umbrella for my activi- ties” www.researchgate.net/publication/220243993_Richard_Bellman_on_the_Birth_of_Dynamic_Programming
Bro are u a GM on CF or wot , u explaining concepts like that 😮 reminds me of my DSA trainer online 😮😮😢
0:33 can’t believe we are still taking shots at the verse pc build guide
You are fucking amazing guy, wtf. Thanks a lot
2:27 ”different view of not only DP, but also problem solving - as a hole” - I get it now, DP and holes go toghether, makes sense
I see what you did there ... 🧐
Is your problem solving adapted from how to solve it? That book’s is next in my reading list
The side effects tidbit was probably the most important part for me. The subproblems must be pure.
“HAANNKKK DONT ABBREVIATE DYMAMIC PROGRAMMING ON THE THUMBNAIL”
great explanation! this made things so clear. how do you get those vim motions in leetcode?
At it's basic essence, dynamic programming is looking for ways to reuse computational steps for multiple steps/iterations of a problem.
Best explanation on the entire planet, the world needs you, man
This video definitely taught me a lot, but I think you may be wrong in the time analysis for the code you wrote. It doesn't look like your caching the values for each state anywhere so the recursion is still doing many recomputations. Due to this I'd say your code has exponential growth rather than polynomial growth. I tested this out by putting your same code into leet code and got a TLE. I then added a 2d array to act as a cache and was able to submit successfully
You might want to check again. @cache is used.
I agree . Dp is just misunderstood. 😂