Dynamic Programming - Learn to Solve Algorithmic Problems & Coding Challenges

  Рет қаралды 4,410,407

freeCodeCamp.org

freeCodeCamp.org

Күн бұрын

Пікірлер: 4 000
@kanuos
@kanuos 2 жыл бұрын
This is definitely the best course on Dynamic Programming I have ever done. Notice, not the _best free_ course, the _best_ course, period.
@SaiyaraLBS
@SaiyaraLBS 7 ай бұрын
a note: go donate on their website, it's tax free (As they are non profit), they get the full amount and you pay no taxes. KZbin charges taxes to both the channel and the donator.
@DailyFacts-vu4cv
@DailyFacts-vu4cv 5 ай бұрын
bro what's your current status i mean are you working ?
@rudycenaronaldo5476
@rudycenaronaldo5476 4 жыл бұрын
No. I don't want to be a software engineer at Google. Please leave me alone algoexpert I just wanna learn dynamic programming.
@donsurlylyte
@donsurlylyte 4 жыл бұрын
resistance is futile, you will be absorbed, prepare for the interview
@MZ-uv3sr
@MZ-uv3sr 4 жыл бұрын
@@donsurlylyte haha...me neither. I should apply just for grins, to see what it's like.
@blossomwithcurls
@blossomwithcurls 4 жыл бұрын
Literally every video I click!!
@rahul_bali
@rahul_bali 4 жыл бұрын
Yeah, man. Whats with the grin .. Little too happy..
@phat80
@phat80 4 жыл бұрын
in fact, this is the most annoying ad ever! This plump woman with a nasty voice will come to me in my nightmares.
@danieladetayo3711
@danieladetayo3711 Жыл бұрын
I am 45 mins in, but I had to stop to drop this comment. This is hands down one of the best tutorials I've ever seen. Alvin is a true teacher. I am blown away by his style. I have taken paid courses on this topic, but this is the first time I am understanding what this is about. I can't wait to finish this tutorial. I am going to go for all your courses.
@DailyFacts-vu4cv
@DailyFacts-vu4cv 5 ай бұрын
bro what's your current status i mean are you working ?
@sanjeeeeev
@sanjeeeeev 10 ай бұрын
This video is hands down the best explanation of DP. The guy did a fantastic job of making tabulation a breeze to understand.
@EdmondNzivugira27
@EdmondNzivugira27 2 ай бұрын
You'll never, and I repeat, you will never find someone on this entire planet who explains things clearly like this guy.. OMG!
@cooladi002
@cooladi002 2 жыл бұрын
Simply THE best dynamic programming course on youtube, wonderfully explained. The course made understanding the difficult concepts a breeze. Loved the progression of problems, even the harder ones felt easy after understanding the basic strategy and the recipe. Thank you freeCodeCamp and Alvin.
@LogansDarling
@LogansDarling 2 жыл бұрын
did u spend money making this comment
@TomasLKarlik
@TomasLKarlik 2 жыл бұрын
@@LogansDarling while I'd argue there are probably better, more direct ways to support a creator, what makes it so weird to you? People have been spending cumulative billions of dollars over the past years just for having their message read on stream or purely for support. It's basically a pay-what-you-want scheme. If you really feel like shaming other people's spending, I suggest you may start with people buying shiny rocks to put on rings with otherwise zero value and ethically questionable production.
@LogansDarling
@LogansDarling 2 жыл бұрын
​@@TomasLKarlik while I'd argue that shaming someone for how they choose to support someone is lame, financially or otherwise, what makes you think that's what I was doing? People have been being confused by the billions of new features YT has put on their platform over the past years just because they're not used to it. It's basically a guess-what-this-symbol-means scheme. If you really feel like assuming the motives of peoples' questions, I suggest you may start with people sarcastically belittling people to cancel anyone who doesn't follow their exact position with otherwise zero value and ethically questionable means. jokes aside i understand how that could be misconstrued as an insult but i was genuinely wanting to kno cuz it could have been like idk - Spending money on a specific comment. - Spending money on a channel. - Spending money on YT. - Spending money outside of the platform and the YTer giving them the badge. - No money even being spent and me just thinking something is a currency symbol. - It could be _anything_ considering how stupid I am, so I have no clue. although if u kno that its for a specific comment then ig u answered me so thx (I do think that it's stupid, but that's more on YT's part than the commenter's part. Seems like a stupid feature to add on the platform, but that hasn't stopped YT before so oh well. ¯\_(ツ)_/¯)
@cooladi002
@cooladi002 2 жыл бұрын
@@TomasLKarlik could you shed more light on the more direct ways to support a creator ?
@ghaznavipc
@ghaznavipc 2 жыл бұрын
first time seeing a GOLDEN -COMMON- comment on youtube (sorry... I played too much hearthstone recently...)
@souravas
@souravas 4 жыл бұрын
It took me a week to finish this tutorial. This tutorial is just pure gold. I always found it hard to understand time complexity for recursive solutions. But this video explains it perfectly. This is probably the best tutorial on dynamic programming. I can't believe you're giving such quality content for free...
@tanngo595
@tanngo595 4 жыл бұрын
Agree
@lowercaseguy3578
@lowercaseguy3578 4 жыл бұрын
I guess you already know how to reverse a binary tree...
@draganostojic6297
@draganostojic6297 3 жыл бұрын
Key is a tree
@marquelamar
@marquelamar 3 жыл бұрын
Agreed.
@pritam-kunduu
@pritam-kunduu 3 жыл бұрын
Same .. I took more than a week
@slpn1
@slpn1 2 жыл бұрын
I've been coding since 1998 and have watched countless tutorials on countless topics. This guy is definitely one of the best teachers I've ever come across.
@sleros7773
@sleros7773 4 жыл бұрын
The first thing I'm gonna do when I get a job is to donate to FCC. I've learned so much from their content on KZbin and tutorials on their website.
@jayeshpandey6940
@jayeshpandey6940 4 жыл бұрын
What a good guy!🎉
@mohdfayaq3037
@mohdfayaq3037 4 жыл бұрын
People like you make me believe in humanity
@riseekt
@riseekt 4 жыл бұрын
Good luck! 👍
@Omar_Al_Seddik
@Omar_Al_Seddik 4 жыл бұрын
Ikr! I'm going to do the same. It's only fair.
@abhi77568
@abhi77568 3 жыл бұрын
FCC rocks
@rajurawat2763
@rajurawat2763 3 жыл бұрын
After getting frustrated from these dynamics programing, after hunting to know the real concepts in books, articles, online paid courses, KZbin videos, finally got this here and that too free. I can't believe this. He teaches like crazy. Thanks a lot.👍
@TheQuancy
@TheQuancy 3 жыл бұрын
Alvin is amazing. He currently works for google right now
@calculator4482
@calculator4482 3 жыл бұрын
That's because he is crazy
@takirr6818
@takirr6818 2 жыл бұрын
He's crazy - 01:04:10 - OBVIOUS MISTAKE - he forgot to calculate space occupided by THE CACHE. Space is O(n * m), not O(n + m) OMG OMG OMG
@Malediction99
@Malediction99 3 жыл бұрын
This guy has the most relaxing voice of any lecturer I've heard.
@feafel
@feafel 2 жыл бұрын
So true!
@tnt7913
@tnt7913 2 ай бұрын
ARE YOU HIGH????????? ON COKE PROBABLY. CAUSE A CRACKED SQUIRREL WOUDL SOUND CALMER.
@nishanck
@nishanck Жыл бұрын
Best content on KZbin on Dynamic Programming! Many thanks!
@krisnrg
@krisnrg 3 жыл бұрын
Phenomenal teacher, I’ve got an hour left and even though I’ve fumbled my way through similar problems I feel I understand everything much better. This is now my go to recommended video for recursion and dynamic coding
@shivamdhir640
@shivamdhir640 3 жыл бұрын
does he teach backtracking in the video ? Haven't started watching it.
@exploringnaturalbeauty2102
@exploringnaturalbeauty2102 3 жыл бұрын
@@shivamdhir640 not specifically but discussed in some questions
@sachinsachin-ms9mr
@sachinsachin-ms9mr Жыл бұрын
I'm here after watching graph algo. I am a data engineer and I always struggled to understand the space and time complexity, this animation is all I ever wanted. This is by far the best video I watched on dynamic programming. Moreover, Alvin has that charm to keep me captivated for long hours without loosing focus. Keep up the great work man!
@billcosta
@billcosta Жыл бұрын
i think it would've been better if you supported his main channel
@ankitjaiswal272
@ankitjaiswal272 Жыл бұрын
@@billcosta can someone please suggest the main channel of the tutor.... His teaching style looks best to me. Thanks
@ranawareviraj
@ranawareviraj Жыл бұрын
www.youtube.com/@AlvintheProgrammer@@ankitjaiswal272
@oii0712
@oii0712 Жыл бұрын
Give this to Alvin
@kingkaixyz
@kingkaixyz 2 жыл бұрын
The visualization and break down of these concepts are so well done. Kudos!
@rankun203
@rankun203 2 жыл бұрын
The moment I saw that tabulation approach for `canSum`, my eyes sparkles!
@pelvispresley22
@pelvispresley22 2 жыл бұрын
This is the slickest way I've ever seen not only Dynamic Programming, but also recursion presented. His slides/animations are just perfect for guiding every single step your brain needs to go through along the way, and he handles all kinds of gotchas and keeps you from getting stuck. I'm already going from "holy cow how am I going to even approach these problems" to "ok this is starting to get intuitive with this workflow" just an hour in. Literally better than any professor's teaching style than I remember from my college CS program. The effort put into this video is insane! I have a feeling this video just covers some of the basics-intermediate problem types, but I bet this will be a great stepping stone to tackling the harder DP problems.
@RandomShowerThoughts
@RandomShowerThoughts 2 жыл бұрын
still can't believe how good this course is, like legitimately taught me more on algorithms, recursion, and dp than anything I've ever seen
@YS-cc1nk
@YS-cc1nk 10 ай бұрын
You mean so?
@SuperAshleyriot
@SuperAshleyriot 4 жыл бұрын
This is the first standing ovation I've given to a KZbin video.
@sakshamsaigal7012
@sakshamsaigal7012 Жыл бұрын
Really found a great starting point to learn dp and found a thinking process to approach the problem with recursion without optimization and then use memorization or go for tabulation
@a2xd94
@a2xd94 2 жыл бұрын
Brilliant video! The entire community of learners owes you a coffee for teaching us this excellent approach to solving the infamous dynamic programming problems. Other videos and books do not go into this well-defined mindset and step-by-step strategy that you need to develop, in order to understand and ultimately solve these problems from a *pragmatic* approach (which is what ultimately aces technical interviews). Keep up the great work, Alvin!
@parashar1505
@parashar1505 11 ай бұрын
Thanks for this wonderful video!
@calvint678
@calvint678 4 жыл бұрын
Damn this guy was the instructor for app academy. His explanations actually put me on the track to understanding this crazy world of code. So glad he's back on the scene!!!
@CoderbyteDevelopers
@CoderbyteDevelopers 4 жыл бұрын
we meet again! thanks for watching -Alvin
@calvint678
@calvint678 4 жыл бұрын
@@CoderbyteDevelopers ooooo you just got a new sub.
@sonukumarkeshri4696
@sonukumarkeshri4696 4 жыл бұрын
Hey join this guys www.scaler.com/event/coding-interviews-dynamic-programming?rcy=1&rce=f6cd5eeb1984
@WillsonMock
@WillsonMock 4 жыл бұрын
@B Q is there a video link for his data structures and programming videos?
@neupsh
@neupsh 4 жыл бұрын
@@CoderbyteDevelopers completely off-topic question if you don't mind: What microphone are you using?
@johnc4624
@johnc4624 Жыл бұрын
Thank you for FREELY supplying QUALITY material.... this DESERVES a recompense. I am COMPELLED to reward you.
@ragzzytv
@ragzzytv 2 жыл бұрын
my man Alvin! I'm a Senior Developer but it was always a grind to brush up DSA topics when I'm in the job hunt. Your videos helped me quantify it a lot. I just watch your DSA videos in 1.5x half a day before an interview and that is all I need. Very well put both for beginners and for folks like me who need a quick run-through. This is the kind of stuff internet is made for. Appreciate the great work. keep it up!
@whatisayoutubehandlebro
@whatisayoutubehandlebro Жыл бұрын
Did you get it
@carocardozo1507
@carocardozo1507 3 жыл бұрын
I finished it and I feel like my head is burning from excitement and curiosity for practicing. It was amazing. Thank you so much for this course
@Daniel_WR_Hart
@Daniel_WR_Hart 3 жыл бұрын
Dynamic programming truly is crystal meth
@khz2172
@khz2172 3 жыл бұрын
how good are you in DP now?
@veipuniilana1842
@veipuniilana1842 3 жыл бұрын
which pograming language are you uisng for coding? If you are using java can i ask you some questions?
@sebryxs
@sebryxs 3 жыл бұрын
@@khz2172 I don't think he's that good, the course only teaches the basics and some simple problems. If you want to become good at DP I think you should practice with some DP problems (from codeforces, for example)
@utopiabinary8258
@utopiabinary8258 2 жыл бұрын
all 5 hours?
@rahultech77
@rahultech77 3 жыл бұрын
Wow. Dynamic programming looked so daunting on the outside. In a matter of 2 days, you changed my mindset about it for good :) Now it seems easy and doable. Many thanks!
@SaurabhGangamwar
@SaurabhGangamwar 2 жыл бұрын
Thanks you so much. This is the best Dynamic Programming course. Thank you for putting lot of efforts for explaining with diagrams.
@prm1234567stphn
@prm1234567stphn Жыл бұрын
Thanks a lot for this amazing content. Im just contributing the money I can.. this course is a gem .
@gustavocieslar
@gustavocieslar 2 жыл бұрын
Excellent material, thanks!
@moonraker61
@moonraker61 6 ай бұрын
Hey, I agree too. Looking for a learning on work experience.
@Frivolicious
@Frivolicious 2 жыл бұрын
This video helped alot!
@botane7538
@botane7538 Жыл бұрын
Thank you for knowledge sharing.
@lelouchnorequiem1357
@lelouchnorequiem1357 4 жыл бұрын
Quality content from Quality Teachers,that too for free!!❤️❤️
@sonukumarkeshri4696
@sonukumarkeshri4696 4 жыл бұрын
Hey join this guys www.scaler.com/event/coding-interviews-dynamic-programming?rcy=1&rce=f6cd5eeb1984
@neerajkale
@neerajkale 4 жыл бұрын
Someone tell this to WhiteHatJr ppl
@अण्वायुवरीवर्त
@अण्वायुवरीवर्त 4 жыл бұрын
@@neerajkale I can't still fathom that scam is still running
@lighttheoryllc4337
@lighttheoryllc4337 4 жыл бұрын
Assalamualaikum brothers and sis, I am seeking Software Engineers, whom can code in Tensor flow and RNN Time series. I am paying.. I am based in USA.. Please check out lighttheory.page/ or email us at info@LightTheory.tech SALAM
@cedricvillani8502
@cedricvillani8502 4 жыл бұрын
Did you say free?? Because I count 16 ADs they placed in the video
@mingzhang5167
@mingzhang5167 2 жыл бұрын
Many thanks for the high-quality course!!! Definitely learned more than $5! Hope you can create more in the future!
@hello777l
@hello777l 3 жыл бұрын
This is hands down the best crash course on dynamic programming. After struggling for so many hours on dp, I actually feel that I understand the logic and process for tackling dp problems now. Thank you for this amazing video!
@gladiator1234567891
@gladiator1234567891 Жыл бұрын
Thanks, well explained to make it easy to understand.
@preetijindal5030
@preetijindal5030 4 жыл бұрын
I am writing this review by just viewing the content for 30 mins. I loved it. I was bit reluctant to start as Dynamic Programming is very difficult and yet very important at the same time. This has given me a boost of confidence as i was able to code the same concept in Java. Thank you so much. And Happy Coding everyone. No matter how difficult it seems, we would go through it Together. :)
@bhargavpandya9189
@bhargavpandya9189 3 жыл бұрын
Man, Alvin, I watched your Graph Algorithms course first and I absolutely loved it! I saw people there, recommending this legendary course and I just knew I had to come here! Every single second watching this video was completely worth it! There is no way I can praise your explanation enough Alvin! There just is not! After this going through this video, I went from literally have no clue whatsoever about what dynamic programming even means, to completely falling in love with this subject. I would surely indulge myself into this subject, and I believe that this video right here is simply the best entry point for any developer out there who is willing to learn this subject. Thanks Alvin. I am really very grateful!!
@ytg6663
@ytg6663 2 жыл бұрын
Link
@Fredchin18
@Fredchin18 2 жыл бұрын
@@ytg6663 kzbin.info/www/bejne/qoi5iJh3pr9jjbc
@LeetCodeSimplified
@LeetCodeSimplified 4 жыл бұрын
Had I searched for "dynamic programming" two days earlier, this video wouldn't even have been uploaded to youtube. The timing couldn't be better!
@nivmorabin
@nivmorabin 2 жыл бұрын
Perfectly made and superb problems choice! Thank you so much
@roberageleta6465
@roberageleta6465 2 жыл бұрын
Thanks!
@WillsonMock
@WillsonMock 4 жыл бұрын
This is one of the most clear and succinct explanations on the memoization and tabulation techniques for dynamic programming!
@veipuniilana1842
@veipuniilana1842 3 жыл бұрын
which pograming language are you uisng for coding? If you are using java can i ask you some questions?
@warrentait4610
@warrentait4610 4 жыл бұрын
I can't believe you made this with over 2,000 slides. You're a hero.
@lilpapa7598
@lilpapa7598 3 жыл бұрын
What did he use to create those slides ?
@CST1992
@CST1992 3 жыл бұрын
Yeah, that coordination is spot-on.
@nazark01
@nazark01 Жыл бұрын
Thanks! Legend coach.
@QifanDeng
@QifanDeng 2 жыл бұрын
That's extremely clear! Had fun and learnt. Thanks Alvin! Btw, the exceeddings (3:20:45) of array at line 5 and 6 are okay for js, but may trouble other language practicing.
@jertdw3646
@jertdw3646 2 жыл бұрын
do you know what programming language he is using?
@QifanDeng
@QifanDeng 2 жыл бұрын
@@jertdw3646 Isn’t it NodeJS?
@KenPryde
@KenPryde 2 жыл бұрын
@@jertdw3646 It's JS ran through through the Node interpreter
@devandeva4374
@devandeva4374 3 жыл бұрын
I love the way he teaches and his love for coding can be seen in his face, whenever he smiles after hitting the code. Thanks man
@ssandeep79
@ssandeep79 3 жыл бұрын
Definitely, one of the best courses to start with DP. Just started with the tabulation approach and, decided to attempt it after watching the initial explanation. But decided to follow a different approach as below: def fibDPTabulation(position): if position
@vekyll
@vekyll 3 жыл бұрын
Yeah, I wondered that too, why he's doing forward tabulation instead of backward one. But for the later problems with strings, it really makes much more sense to think forward, so he just wanted to establish consistent practice.
@vishnusumanth350
@vishnusumanth350 Жыл бұрын
This simplicity is what I am looking for .This is right tutorial I can ever ask for !!!! Awesome collection of problems .
@bernhardbaumgartner4702
@bernhardbaumgartner4702 2 жыл бұрын
I've never seen anyone before who was able to better and more clearly explain dynamic programming. The way you're leading us there step by step and also how the material is presented is outstanding. I'm very impressed Good Sir :-) Thank you very, very much 🙇
@zeeg404
@zeeg404 2 жыл бұрын
Simply incredible. Keep it up, you're making an invaluable impact on those who need a little extra help :)
@nastrimarcello
@nastrimarcello Жыл бұрын
I'm not one to watch any 5 hour video but this one really hooked me to go all the way. Explaining hard things in a simple and engaging way is hard and you delivered it perfectly.
@gnes04
@gnes04 2 жыл бұрын
Great explanation thank you
@jleal666
@jleal666 3 жыл бұрын
1:04:12 The number of paths of [2,3] is the same as [3,2], so the function can be optimized a little more by sorting the keys: if m
@siidsharma5349
@siidsharma5349 3 жыл бұрын
you're right, so that solution give O((m+n)/2)
@kumaranp8764
@kumaranp8764 3 жыл бұрын
@John Leal i was looking for this in the comments memoized base case after this optimization would look like if (m, n) in memo: return memo[(m, n)] elif (n, m) in memo: return memo[(n, m)]
@Mihir.Hundiwala
@Mihir.Hundiwala 3 жыл бұрын
Finally i found the comment i was looking for thanks.
@J3rs3yM1k3
@J3rs3yM1k3 3 жыл бұрын
Exactly. He even mentions this while describing the solution, but didn't implement it.
@Mark33090
@Mark33090 3 жыл бұрын
Was wondering that too, I tried it out... Passing a grid of 500,500, I measured the time it took for it to run... 230ms without and 125ms with the sorting.
@joshuabenson2568
@joshuabenson2568 3 жыл бұрын
This course just proves that when you go through each minute detail of a problem in a calm and precise manner, while also hinting at the obvious even, a student is much more likely to pick up on the subject. Judging by all the other comments, slower people like myself are starting to get the concept. 🤣 Fantastic coure, thank you very much for uploading this piece.
@puppergump4117
@puppergump4117 3 жыл бұрын
I don't think it's about slow or quick, it's just that schools don't teach us how to think. They just cram crap down our throats and expect use to puke up rainbows.
@ingaprobatorem5839
@ingaprobatorem5839 2 жыл бұрын
The author did not include in the compute complexity the access of the memoized data. For the fibonacci, the algorithm can be optimized to o(1) instead of o(n).
@ingaprobatorem5839
@ingaprobatorem5839 2 жыл бұрын
o(1) for storage.
@supriyabansal7036
@supriyabansal7036 2 жыл бұрын
Thanks for the great content. In gridTraveler problem, base condition could be that if either of rows or columns is 1 , we can return 1 So, if(m == 1 || n == 1) return 1; And i think we could just check m and n interchangeably : if ((m + "-" + n) in memory) return memory[m + "-" + n]; if ((n + "-" + m) in memory) return memory[n + "-" + m]; As number of ways to travel a grid for (2,3) will be same as number of ways in case of (3,2)
@SamYuXiaofei
@SamYuXiaofei 2 жыл бұрын
This is an amazing and helpful tutorial! For GridTraveler program, we can solve it analytically. Assume a grid with size m*n , then to go from the top left to the bottom right, the total number of step moving right has to be (n-1), and the total number of step moving bottom has to be (m-1), the overall total number of step has to be n-1+m-1 = m+n-2. Any particular path is an arrangement of steps of these two types of directions. Therefore, it is equivalent to say that if we have total m-1+n-2=m+n-2, then count the number of ways we can pick m-1. So the analytical solution is (m+n-2)!/[(m-1)!(n-1)!] , where ! means factorial
@gopishivakrishna9707
@gopishivakrishna9707 3 жыл бұрын
After finishing this video in 2 full days, I am able to come up with an approach now, and write solutions. No matter how much efforts I made to learn dp, I was no where close to coming up with a neat approach. With these concepts and some more practice on the DP problems, I can sure be good as a hell pro problem solver in a month.
@autismo1969
@autismo1969 3 жыл бұрын
This man literally taught me more dynamic programming than paid university courses
@khanaleena1161
@khanaleena1161 3 жыл бұрын
Kis language ka hai, c ya c++ ,ya java
@milkmeapollo9048
@milkmeapollo9048 3 жыл бұрын
This is the problem with America lol
@exploringnaturalbeauty2102
@exploringnaturalbeauty2102 3 жыл бұрын
@@milkmeapollo9048 entire world dude , I aint american but my country has the same problem , universities are the biggest scams ever.
@zackjandali
@zackjandali 3 жыл бұрын
@@ScorpionKing-z8n it's not a scam but they are definitely over priced. I think of college as my source for what I need to know, and the internet (mainly youtube) as my source of knowing those things. Without college/universities, it's hard to know what you need to know. It would take a lot of asking questions and bothering people who didn't sign up to be questioned... lol
@juanandrescastillofuenmayo6619
@juanandrescastillofuenmayo6619 3 жыл бұрын
I usually can't symphatize with ppl who say this, but yeah, DP is probably the biggest thing the internet has been able to taught me better than a price-near-the-seven-hundred-thousand-colombian-pesos uni course.
@v_saaam
@v_saaam 2 жыл бұрын
Thank you! It was an amazing course!
@isfland
@isfland 3 жыл бұрын
It's amazing to realize that grid traveler problem sounds like a completely different problem to fibonacci, but it's solved with the same pattern. Just wow.
@WillCrawford0
@WillCrawford0 3 жыл бұрын
@black c yeah, C(m + n, n).
@veipuniilana1842
@veipuniilana1842 3 жыл бұрын
which pograming language are you uisng for coding? If you are using java can i ask you some questions?
@KartikayKaul
@KartikayKaul 8 ай бұрын
You will find in theory of computation that the problems are divided into sets of similar problems ie we can reduce any problem to any other problem to solve and if we can solve just one problem in that set in an more efficient time complexity then we can solve other problems in that set the same way
@AHMEDADEL-qx2ip
@AHMEDADEL-qx2ip 2 жыл бұрын
After graduating with a CS degree and working for 2 years, I can finally explain to someone what DP is! Phenomenal and unbelievable course. Can't thank you enough for this high-quality content.
@ytg6663
@ytg6663 2 жыл бұрын
R u doing job ?
@terrymiller111
@terrymiller111 3 жыл бұрын
You are a coding instructing master. There are millions of people who code, but only a few coding instructing masters. Great stuff. You deserved every one of those subs and likes.
@danielnadar75
@danielnadar75 Ай бұрын
This is amazing! Like I can’t believe quality stuffs like this exist for free! ❤ Keep up the amazing work, This will be my go to video for Dynamic Programming and even for my kids and their kids 😁
@zjucypher
@zjucypher 2 жыл бұрын
This is THE BEST algorithm course I have ever seen on youtube. Wish there are more videos like this!
@yangtairan
@yangtairan 3 жыл бұрын
This is probably THE best DP tutorial on the web! Kudos to FCC, Coderbyte, and Alvin.
@paulchoudhury2573
@paulchoudhury2573 4 жыл бұрын
This the best and most informative explanation of DP I've seen in 25 years! Great job and I hopefully some day you'll be compensated well for your outstanding teaching ability.
@davidchen1900
@davidchen1900 4 жыл бұрын
This guy is going to be invited to my wedding.
@swordofgrayskull1530
@swordofgrayskull1530 4 жыл бұрын
Make sure you have a prenuptial aggrement bro.
@smokey2988
@smokey2988 4 жыл бұрын
Same
@erikfrits6553
@erikfrits6553 4 жыл бұрын
and this will be his 5 hour-long toast speech :D
@yashchauhan5685
@yashchauhan5685 4 жыл бұрын
Invite me too, i wanna meet him 😂😂
@technotv3227
@technotv3227 4 жыл бұрын
Better still, marry him !
@jvixtor
@jvixtor 2 жыл бұрын
Thanks for the fabulous course 👏🙏One modification that I think the video needs is that for the grid travel algo with memoization, the space complexity is O(m*n) and not O(m+n) [1:04:15]. The stack of course uses O(m+n) space but the 'memo' object grows to store m * n key/val pairs. So the overall space complexity would be O(m*n).
@diegorocha2186
@diegorocha2186 2 жыл бұрын
In the example of canConstruct 2:24:00 you can use the method `startsWith` since you're just interested in knowing if the target starts with the word, so you don't need to traverse the entire string finding the index! Amazing course btw I really appreciated!
@repentandbelieveinJesusChrist3
@repentandbelieveinJesusChrist3 2 жыл бұрын
Repent to Jesus Christ “We demolish arguments and every pretension that sets itself up against the knowledge of God, and we take captive every thought to make it obedient to Christ.” ‭‭2 Corinthians‬ ‭10:5‬ ‭NIV‬‬
@ItsAllAFacade
@ItsAllAFacade Жыл бұрын
@@repentandbelieveinJesusChrist3 Annoying-ass bot.
@ItsAllAFacade
@ItsAllAFacade Жыл бұрын
Also, I was thinking, can't you also use a trie to pre-compute data within the word bank, so you can efficiently access it during the recursion?
@kirillzlobin7135
@kirillzlobin7135 Жыл бұрын
YOu should be given an award as the best tutor on Dynamic Programming concepts in the history!!! You approach is so detailed and step-by-step. You found the best formula on how to teach these complex things. Thank you very much for your job!!!
@hackytech7494
@hackytech7494 3 жыл бұрын
This is one of the best explanation for Dynamic programming on entire KZbin. I have never seen such an clean and Fantastic explanation. Thanks alot
@pablogarin
@pablogarin 4 жыл бұрын
47:00 last node to the right should be 2,0... still a base case, so no difference overall, but it's best to clarify to prevent people of confusion and frustration...
@kamalkamalazmi2226
@kamalkamalazmi2226 4 жыл бұрын
Definitely one of the best instructors I've ever known. Thank you sir
@BenjaminGretsch
@BenjaminGretsch 6 ай бұрын
Thank You!
@giulio4686
@giulio4686 3 жыл бұрын
This is a great short course with a great teacher!! 😉😉😉😙 The classes I attended about dynamic programming in my university are not even comparable to this. This is much more understandable, well presented and makes you want to keep learning the topic.
@tmanley1985
@tmanley1985 Жыл бұрын
This is the best dynamic programming content I've ever seen. What I found particularly helpful is being able to understand and view recursive problems as a tree. Because of course trees are recursive data structures. When you have a tree from the outset, as long as you understand general principles of DFS and BFS, a lot of solutions become obvious. What this guy does is show a way to make the implicit, explicit. It's that step that is usually the most difficult because sometimes you're just given a number and asked to solve the problem. Once you understand that problem with that starting value represents a tree of decisions, it allows you to visualize it in such a way that the solution becomes evident. Great job.
@synhegola
@synhegola 3 жыл бұрын
Great so far. If the first half hour is an indicator of the rest, I already learnt more in that half hour than in the past 10 years... Great job
@kalyaniwankhade5597
@kalyaniwankhade5597 4 ай бұрын
Thanks
@mounika2973
@mounika2973 4 жыл бұрын
Before I thought I would never be able to solve problems using dynamic programming , but now I have a lot more confidence. Thank you for this amazing video😁
@sonukumarkeshri4696
@sonukumarkeshri4696 4 жыл бұрын
Hey join this for more stuffs www.scaler.com/event/coding-interviews-dynamic-programming?rcy=1&rce=f6cd5eeb1984
@cocolasticot9027
@cocolasticot9027 2 жыл бұрын
Learning to code by myself, this course brought me so much. I didn't know anything about dynamic programming, not much about time and space complexity. Now I wouldn't say that i master it of course, but with those great explanations and examples I happened to cruise through all these exercises with ease. I am genuinely shocked to see how easy it is for me now, as those problems just seemed impossible before and their solutions looked like witchcraft. Thank you so much, this is a wonderful course !
@johnvanschultz2297
@johnvanschultz2297 3 жыл бұрын
This is one of the best videos on both recursion and dynamic programming I've ever seen. Thank you for making this available and sharing this knowledge with the programming community.
@DemX_HaX
@DemX_HaX 11 ай бұрын
one of the worst things about learning new DSA concepts is the jump in logic/thinking thats made where it doesn't make sense until you've done a million examples because people don't really explain their thought process and the intuition behind it much. this has none of those issues. this is probably the best DSA video i think i ever seen. amazing work, thank you. 🎉
@vimalalwaysrocks
@vimalalwaysrocks 3 жыл бұрын
The good teacher explains. The superior teacher demonstrates. The great teacher inspires. You are a great teacher Sir! Thank you!
@romanzelinskyi7566
@romanzelinskyi7566 3 жыл бұрын
The best Dynamic Programing course I've had so far, thanks a lot for the best teacher.
@veipuniilana1842
@veipuniilana1842 3 жыл бұрын
which pograming language are you uisng for coding? If you are using java can i ask you some questions?
@MANISHKUMAR-vt3lp
@MANISHKUMAR-vt3lp 2 жыл бұрын
00:00 Intro to dynamic programming 3:22 Understanding the need for Dynamic programming 10:48 Understanding time complexity and space complexity 22:27 Back to the need for dynamic programming with an example 23:31 Dynamic programming - how it reduces the time complexity 25:56 Implementation of dynamic programming using memoization 38:38 More problem
@sehajsingla3029
@sehajsingla3029 8 ай бұрын
Hands down. I am not a very good student of programming however, the way this person teaches is impeccable. I am solving questions side by side and I am getting all the answers right within the first go. Thank you so much for your efforts and you should really teach me everything because I am UNSTOPPABLEEE.
@anandjain2407
@anandjain2407 3 жыл бұрын
Apart from the knowledge served, I also want to appreciate the work done to choose colours for slides. It works so perfect for both day and night mode.
@donatellodonini3147
@donatellodonini3147 3 жыл бұрын
Thanks for this tutorial: with your lectures I improved an algorithm that calculates any of level the Pascal's triangle, it was really satisfying to see the big improvement with a very few lines of code
@SebinMatthew
@SebinMatthew 4 жыл бұрын
No book can explain DP this well and believe me I have tried!
@lighttheoryllc4337
@lighttheoryllc4337 4 жыл бұрын
Assalamualaikum brothers and sis, I am seeking Software Engineers, whom can code in Tensor flow and RNN Time series. I am paying.. I am based in USA.. Please check out lighttheory.page/ or email us at info@LightTheory.tech SALAM
@chukwuemekainya3043
@chukwuemekainya3043 2 жыл бұрын
Very lovely tutorial. I finally feel confident about solving recursion and DP problems. I have a observation: At 2:32:27, why is the target.indexOf(word) === 0 not factored in, in the calculation for time complexity. Even though we are comparing against 0, target.indexOf(word) will first search through the word, which is (O(m)) before comparing against 0. This should leave us with an overall time complexity of O(n ^ m * m ^ 2).
@blossomwithcurls
@blossomwithcurls 4 жыл бұрын
You literally explained the course in a simple and legit way!! So, DP can be this easy??? 🏃🏾‍♀️🏃🏾‍♀️ me heading to leetcode to solve the hard DP problems!
@djohn0909
@djohn0909 3 жыл бұрын
Did you solve some?
@karanveersingh5535
@karanveersingh5535 3 жыл бұрын
Just read the question and backed off???
@LordLoldemort7
@LordLoldemort7 3 жыл бұрын
@@karanveersingh5535 LMAO
@A1n2o3s4h5
@A1n2o3s4h5 3 жыл бұрын
This needs follow-up
@arisu7404
@arisu7404 3 жыл бұрын
Famous last word
@jasonford1
@jasonford1 4 жыл бұрын
It is always a treat to find content perfectly paired to one's journey in programming. For me, this content is exactly what I need. Thank you Alvin and thank you FCC for distributing! Unbelievable that this is free.
@abhinavsadhu
@abhinavsadhu Жыл бұрын
Hey! you'd mentioned that 2,1 or 1,2 basically return the same value previously but in the code these values are being separately calculated... at 1:01:50 by using, const key1 = m+","+n; const key2 = n+","+m; we can check for both key1 or key2 in memo and return the associated value. (also, great video! loved the visualizations!)
@eswarv5813
@eswarv5813 7 ай бұрын
Thank you so much ❤❤
@doxuanhoang8767
@doxuanhoang8767 3 жыл бұрын
Computer Science students would appreciated this very much. Thanks for intelligible explanations !
@asatzhh
@asatzhh 4 жыл бұрын
At around 21:00 you can not remove the half on the exponent. O(2^(n/2)) is infinitesimal with respect to O(2^n).
@herp_derpingson
@herp_derpingson 4 жыл бұрын
20:57 No you cannot simplify O(2^(n/2)) to O(2^n) as 2^(n/2) cannot be expressed as a * 2^n + b * 2^(n-1) + ... + c form. 1:04:08 No, the cache size can become n * m / 2 in the worst case. So, the space complexity should also be O(n * m)
@ElGalloUltimo
@ElGalloUltimo 4 жыл бұрын
Thanks for pointing this out. I was about to comment on the O(n * m) space complexity.
@henryfajardo3750
@henryfajardo3750 3 жыл бұрын
but wouldn't 2^(n/2) simplify to sqr(2)*2^n?
@henryfajardo3750
@henryfajardo3750 3 жыл бұрын
after checking closely what I said is in fact not true lol
@erithion
@erithion 3 жыл бұрын
It is not a simplification. I guess what he meant was big O in the academic sense, i.e. the upper bound function. Since 2^(n/2) == sqrt(2)^n, so you can say that it is always less than 2^n.
@erithion
@erithion 3 жыл бұрын
What I can't grasp is how he got O(n^m * m) in the unoptimized howSum. Upon each recursive call you do at most one copy of m elements, and you do it m times, so the final O is O(n^m + m^2).
@baljinderbenipal5804
@baljinderbenipal5804 Жыл бұрын
Thank you for this tutorial! I'm still going through it, but I wanted to keep a track of any errata I encounter in this comment. 47:00 - The rightmost leaf is labelled as (0, 0) as opposed to (2, 0) 1:04:05 - The space complexity is stated as O(n + m); however, memoization takes O(n*m) space. So, the overall space complexity is O(n*m).
@philemonariko1173
@philemonariko1173 Ай бұрын
Nope. Space complexity is actually O(n + m). The space complexity is dictated by the maximum number of recursive calls in the call stack. For every recursive call either n or m is decremented by 1 until a base case of n = 0 or m = 0. The maximum number of recursive calls in the call stack is m + n. Each stack frame takes O(1) space . That makes total space complexity O(m+n)
@ivansemenov9023
@ivansemenov9023 4 жыл бұрын
The best education video I saw in my life. Alvin, thank you for your effort. Looking forward for more videos like that for another subjects as well.
@CoderbyteDevelopers
@CoderbyteDevelopers 4 жыл бұрын
Thanks for the high praise! -Alvin
@Voloskaya
@Voloskaya 3 жыл бұрын
Really good video, so well explained. Unless I am missing something I think there is a small mistake in the time and space complexity of howSum: There is no need to store the positive result (an array in this case) in the memo object, since as soon as we find one good result, we stop the exploration and just return all the way up, so no other recursive call will be made, and the memo object will never be checked again. Only storing false/null is useful. By that logic, even if you do store the array in memo, at most there will be a single array of length m in memo, so the space complexity would be O(m*2) so O(m) and not O(m*m). In the same way, we are going to create a new array at most m times (a single path will ever return an array, never multiples, so 1 time per node in the path), so time complexity of copying the arrays would be O(m) again, for a total time complexity of O(n*m+m) instead of O(n*m^2). So basically, you are assuming that in the worst-case scenario (say a numbers array filled with 1) every single path will return an array, while in reality it's always at most 1 path, since we stop all exploration as soon as we have one match. Am I missing something?
@SaraAhmed-zp6rk
@SaraAhmed-zp6rk Жыл бұрын
- I agree with you regarding the first part "There is no need to store the positive result (an array in this case) in the memo object" - Regarding the second part of analyzing the space and time complexity (even if you do store the array in memo, at most there will be a single array of length m in memo) , take care that we are copying the whole array at each call (i.e. each element of the memo will be an array). Each element is an array that represents the **whole path** from that **current** targetSum to the leaf (i.e. it would be sth like memo = { [3], [3,2], [3,2,2]}). memo will contain multiple arrays of lengths ( one , two, three, ...... m)
@philemonariko1173
@philemonariko1173 Ай бұрын
I agree with you. I also noticed it. The copying of array occurs at most m times. I checked this by incrementing a global variable for every recursive call that copies an array. That means the total time complexity for brute force would be O(n^m + m^2) and for the memoized O(n*m + m^2)
C Programming Tutorial for Beginners
3:46:13
freeCodeCamp.org
Рет қаралды 17 МЛН
Graph Algorithms for Technical Interviews - Full Course
2:12:19
freeCodeCamp.org
Рет қаралды 1,3 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
The mind behind Linux | Linus Torvalds | TED
21:31
TED
Рет қаралды 6 МЛН
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 244 М.
Pointers in C / C++ [Full Course]
3:47:23
freeCodeCamp.org
Рет қаралды 4,9 МЛН
Programming with Math | The Lambda Calculus
21:48
Eyesomorphic
Рет қаралды 257 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 812 М.
Recursion in Programming - Full Course
1:51:36
freeCodeCamp.org
Рет қаралды 981 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 765 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН