Best video found for dynamic programming.You explained the problem with real-time example and that's what is needed to understand any concept..Amazing work done.. A big thanks for your effort.
@brycecullen3183 Жыл бұрын
Amazing explanation. The comparison of the three Fibonacci functions finally made the differences between top down and bottom up "click" for me.
@Snakes.StartToSing3 жыл бұрын
I was confused with all the naming and which was which , top down, recursion, hash table, etc....you made it super easy to understand , thank you Andrey
@mimi444-h8q10 ай бұрын
brilliant! Love your way of teaching ,this series is amazing.
@andreygrehov10 ай бұрын
Thank you! Enjoy!
@shatadruroy39264 жыл бұрын
Andery! You are really amazing. These videos have taught me how to approach dynamic programming problems! Please continue this great work. This channel will get the recognition it deserves
@baqirhusain56523 жыл бұрын
Thank you .. beautiful consumable explanation ... interestingly I was using all the approaches unknowingly what they were called explicitly. Thanx
@chun-yikuo70324 жыл бұрын
Brilliant Series!! MILLION THANKS to your effort!!
@algoseekee4 жыл бұрын
Andrey, thanks! Keep going 👍
@andreygrehov4 жыл бұрын
Thank you, Viktor!
@DavidCastro-sn3iy4 жыл бұрын
Andrey! just passing by to say THANKS! such an amazing content. DP has bee none of my improvement areas for quite a while, always trying to figure out how it's done and how it works through coding examples but not as clear as you do it in your videos and with the amazing framework you designed. Keep up the good work!!!
@אופירמטוטי4 жыл бұрын
andrey im so happy that i found your channel . keep going!! your content is absolutely the best that i have seen for DP problems
@ritikapande212 жыл бұрын
These are some amazing videos of the problems which look more like mathematical problems and I had often wondered where to begin solving them. I have been binge watching your videos and believe me these are more enjoyable than Netflix series.
@andreygrehov2 жыл бұрын
Haha, thanks a lot, Ritika!
@bushigi5913 Жыл бұрын
This is exactly what we need for learning DP!!!
@andreygrehov Жыл бұрын
Hehe, thank you!
@CharanRai Жыл бұрын
Hey Andrey! Thank you so much. Your explanation is top-notch!. brilliant.
@ashwinbabu0073 жыл бұрын
can someone explain the bottom-up backward : lets say n = 3. in the first iteration we would have to calculate:- dp[2] = dp[1] + dp[2] and dp[3] = dp[1] + dp[3] It doesn't make sense to me cos we haven't calculated dp[2] and dp[3], won't it throw an error? Please explain.
@louysatv2 жыл бұрын
did you find the solution for that? it doesn't work for me either: const fib = (n) => { const dp = [0, 1, 1]; for (let i = 1; i < n; i++) { dp[i + 1] += dp[i]; dp[i + 2] += dp[i]; } return dp[n]; }; fib(8) return this array: [0, 1, 2, NaN, NaN, NaN, NaN, NaN, NaN, NaN]
@SonLe-mi9xy11 ай бұрын
In Go, when you declare an array, all initial values are automatically set to zero. However, in some other languages, you may need to initialize these values to zero manually.
@BenNelsonillegalnumbers4 жыл бұрын
Great video! Looking forward to the next. Where did you get that cardigan! Fresh.
@andreygrehov4 жыл бұрын
Thank you, Ben! Next videos are coming early September, as soon as I'm back from Europe. Haha, this is a Polo Ralph Lauren cardigan. Thanks for the compliment 🙌
@StackJobs Жыл бұрын
They say that bottom-up dynamic-programming is the real dynamic programming, and the top-down dynamic programming is just a recursion plus memorization. 👍
@9fxhrlif9er3 жыл бұрын
Thank you so much for this Andrey! I have both liked this video and subscribed to your channel so you get more exposure!
@SuperRalphinator4 жыл бұрын
Beautiful! I just commented about covering this on your previous video and you already did. I just hadn't got that far yet.
@andreygrehov4 жыл бұрын
Appreciate it, Ralph!
@xxRAP13Rxx10 ай бұрын
Thank you so much for your video Andrey! I did have a few questions: at 6:35, you say top-down dynamic programming is "memoization + recursion". I don't think you said this in the video, but would bottom-up dynamic programming be "tabulation + iterative" (i.e. all bottom-up approaches can only be done with an N-D array and NO recursion)? Could top-down programming be done iteratively with memoization and NO recursion? Could bottom-up programming be done with memoization and/or recursion? I take it ANY dynamic programming approach MUST use at least memoization or tabulation to easily recall previous results?
@andrewthompson41482 жыл бұрын
this literally explained all of mainstream media
@chunghosong79044 жыл бұрын
Best DP videos in KZbin. just subscribed your channel, and waiting for more DP videos. Keep up the good work!
@linhvu9638 Жыл бұрын
fantastic explanation, many thanks
@elinorkent71882 жыл бұрын
that was super helpful. really cleared up a lot of things for me.
@pranavsingh10813 жыл бұрын
Clear explanation which my prof could not teach me
@jinhuang7258 Жыл бұрын
Fantastic video! Thank you!
@Metachief_X Жыл бұрын
brilliant explanation, thank you!
@blasttrash4 жыл бұрын
nice series. do u plan to upload other videos?
@andreygrehov4 жыл бұрын
Yes. I'm traveling until end of August. I'll get back to work as soon as I'm back. We have a lot more to learn.
@stuband41593 жыл бұрын
Even faster, but not using dynamic programming, is to use Binet's approximation which is f(n) = nearest integer to golden_ratio^n / sqrt(5) where golden_ratio = 1.61803398875 it's an irrational number but that value will do the trick f(20) = 1.61803398875^20 / sqrt(5) = 6765.000029572719 so the answer is 6765
@sumodbadchhape98234 жыл бұрын
Very helpful 👌 can you cover one of the most difficult problem the egg drop problem? Find the minimum number of egg drops to find the non breaking floor ?
@yashtibrewal42593 жыл бұрын
Thanks, I just watched the first half of the vid, the theory is what I needed, you want wanna split the videos into... double views ;)
@shivamtyagi99364 жыл бұрын
Andrew Ng and now u !!!! Great work
@Ploofles3 жыл бұрын
Thank you so much I really needed this
@JasonLee-pr4sx Жыл бұрын
A better top-down solution, to reduce the times of entering function(stacking), to use the array to replace f(n-2). int fibo_seq(int n, int * arr) { if(n>2) { arr[n]=fibo_seq(n-1,arr)+arr[n-2]; } else { arr[n]=arr[0]+arr[1]; } return arr[n]; } Fibo_seq=new int[N+1]; Fibo_seq[0]=0; Fibo_seq[1]=1; fibo_seq(N,Fibo_seq);
@pl5778 Жыл бұрын
Hi Andrey just came across you channel and your DP lessons are awesome! I had a question - is dp[0] = 0 or is it dp[0] = 1? I think you had both in various videos. If it is 0 i understand why, but what if its 1 what is the explanation? thanks!
@andreygrehov Жыл бұрын
The dp[0]=0 vs dp[0]=1 usually depends on the kind of DP problem you are trying to solve. When it comes to minimization problems (questions like: what's the minimum number of.....) then dp[0] is most often 0. When it comes to counting things (questions like: what's the number of ways to do ....) then dp[0] is most often quals to 1. Try to solve a few more basic DP problems and point your attention on base cases.
@suchitragiri45463 жыл бұрын
Very nicely explained!
@Benjamin-Chavez3 жыл бұрын
Wow. Thank you, this is so helpful!
@andreygrehov3 жыл бұрын
Glad you liked it, Ben. Thanks for watching.
@shaoronkantor76194 жыл бұрын
in fibBottomUpDpBackward you overwrite dp[i+1] on next interation. It would be better to use i = i + 2
@zt_yang4 жыл бұрын
Thanks for your great work, please keep going~
@iamgirraj3 жыл бұрын
Thanks Andrey...❤️
@meganfoxyou3 жыл бұрын
Great video!
@juncheng59453 жыл бұрын
Great explanation.
@andreygrehov3 жыл бұрын
Thank you, Jun.
@andreygrehov4 жыл бұрын
Hey guys, I'm traveling in Europe, getting back to NY at the end of August. New videos are scheduled for early September. Sorry for the inconvenience, but I haven't seen my family for 3+ years. Stay tuned! Can't wait to get back to work! Next video: kzbin.info/www/bejne/f6KklZt-pbeoabs Previous video: kzbin.info/www/bejne/g4S1hX-wf6mZl8k
@recoveryemail10464 жыл бұрын
Огромнейшее спасибо за ваши старания!
@adrianchandler65113 жыл бұрын
InstaBlaster...
@baqirhusain56523 жыл бұрын
I reallly hope to get to your level where I make no syntax errors or logical errors....One Day
@rishikeyyadav57174 жыл бұрын
Great explanation..
@pranavgupta934 жыл бұрын
Hey Andrey, Thanks for making DP interesting for us. Your videos are awesome!!. Can you please help with the problem statement Given an integer N number of stairs, the task is count the number ways to reach the Nth stair by taking 1 or 2 step any number of times but taking a step of 3 exactly once. Similar to what you have covered in previous videos but can only take 3 steps one time only. Whats should be the logic behind this.
@andreygrehov4 жыл бұрын
Hey, I think one way to solve this problem is by keeping track of how many times 3 steps were taken. I haven't checked if the answer is correct, but check it out: play.golang.org/p/D6tMjqS76ms k represents the number of times dp[i-3] was calculated. Try to draw the staircase on a piece of paper and solve the problem manually. Let me know if the code is correct.
@nicholasdavis95293 жыл бұрын
Why is line 79 and 80 not: dp[i+1] = dp[i] + dp[i-1] dp[i+2] = dp[i] + dp[i+1] or even just dp[i+1] = dp[i] + dp[i-1]
@glensee75063 жыл бұрын
I love it, thanks!
@lyubomirgrozdanov914 Жыл бұрын
WHere did you read all of that?
@mohamedhussien4013 Жыл бұрын
Thank u so much 🥰🥰🥰.
@karankanojiya76722 жыл бұрын
Respect++
@okigan3 жыл бұрын
7:40 - “Top down DP is just recursion + caching” - this has been bothering me all the time - that is so much simpler to explain yet it is buried in layers and layers of over complex acrobatics.
@melvin62284 жыл бұрын
Sooo.... When are you going to talk about the cool applications of DP? :D You said yourself you needed it for a real world use case. I presume you've seen this one as well: avikdas.com/2019/05/14/real-world-dynamic-programming-seam-carving.html I think people would appreciate it when that gets turned into a video (when you believe you're at the right level for it in your series)
@andreygrehov4 жыл бұрын
Hey @Melvin, yea, I've seen this article before. It's amazing. Real world applications is something I'm going to cover at the end of the course, right before we jump into Advanced Dynamic Programming (which is prob worth releasing as a separate course).
@renkuro12212 жыл бұрын
Please get a new marker
@pisanghangus24 жыл бұрын
You need to invest in a new marker pen haha
@pisanghangus24 жыл бұрын
but really good video explaining top down vs bottom up approach in dynamic programming.
@andreygrehov4 жыл бұрын
Haha, I hate these markers. Good call.
@waytospergtherebro2 жыл бұрын
Whatever kind of processing you're doing to pronounce English words isn't working at all.