What Is Dynamic Programming and How To Use It

Поделиться
HTML-код
  • Опубликовано: 12 дек 2017
  • *Dynamic Programming Tutorial*
    This is a quick introduction to dynamic programming and how to use it. I'm going to use the Fibonacci sequence as the primary example.
    Sample code is available in Jupyter Notebook and plain Python at: www.csdojo.io/dpcode
    Keep in touch on Facebook: / entercsdojo
    Support me on Patreon: / csdojo

Комментарии • 1,6 тыс.

  • @CSDojo
    @CSDojo  6 лет назад +628

    I missed putting a second argument (memo) at

  • @DadBodSwagGod
    @DadBodSwagGod 4 года назад +366

    I feel like an idiot. I never realized that Dynamic Programming wasn’t actually anything special. It’s just a few commonly used strategies for solving any given problem

  • @pguti778
    @pguti778 6 лет назад +432

    Thank you CS dojo !!! I've passed a job interview because of this!!! You're the best!!!

  • @michaelw7769
    @michaelw7769 3 года назад +227

    Well explained! One suggestion for your bottom up approach is that you don't need to use an array with size n to hold all the numbers, you just need 2 variables to hold the previous two numbers, and keep updating them when iterating.

  • @doumkatekz
    @doumkatekz 6 лет назад +514

    Thank you! I'm a developer without a CS degree. Never really needed it but I'm trying to level up my skills and seeking out the things I've missed. Been doing it most of my life and I'm probably twice your age, never mind ego and pride, I'll learn where the learning is. Excellent video and explained very clearly.

  • @maiahilden1998

    your definition of dynamic programming is actually the definition of memoization

  • @JoCS11152
    @JoCS11152 2 года назад +1

    For free... dude, u are goat. People these days dont know how much technology, with a good use and being aware of his cons, can help.

  • @TinOfBeans321
    @TinOfBeans321 6 лет назад +539

    You're great at explaining! I'm a final year comp sci student and have come across fib and dp countless times but this is the simplest and best example I've seen yet. Keep it up!

  • @sergey198
    @sergey198 5 лет назад +153

    You don't even need an array in your "bottom up solution"

  • @echtcipher6682
    @echtcipher6682 5 лет назад +3

    What is bottom up approach in programming?

  • @asdf-od5nm
    @asdf-od5nm 6 лет назад +6

    Make some programming video on your pc

  • @vidyaranyatj7306
    @vidyaranyatj7306 5 лет назад +24

    Smart, Humble and Simple. You're the best my man.

  • @anoops7974
    @anoops7974 6 лет назад +12

    i am a 3rd year computer science student , although i have already done with data structures and algorithms courses . i have never really felt understood . this video helped me so much , hope you will continue doing these to help students like me , i am definitely going to share your works on my class group . please never stop adding more videos , i am looking forward to all your upcoming videos .

  • @nemousama4637
    @nemousama4637 5 лет назад +8

    Awesome video. I'm a professional software developer who has been programming for a decade, and I still found this video helpful to put a name to something I've been doing without thinking.

  • @vendels4154
    @vendels4154 5 лет назад +9

    I must say, this is a very nicely done video, the example problem is simple enough to grasp the concepts for DP beginners like me, but also complex enough to demonstrate the usefulness of it and also impact of the different complexities. I have always had a hard time understanding recursive solutions (my brain just tends to get overwhelmed from it), but after this I actually feel I have a better understanding.

  • @Elena-tj3so
    @Elena-tj3so 6 лет назад +1

    This is by far the clearest explanation of dynamic programming I've seen! It's a topic I keep having to relearn every now and then but I think I finally truly understand it now.

  • @domainxh
    @domainxh 5 лет назад +3

    I migrated from aerospace engineering background to cs roughly two years ago. I can code, but doesn't know much about cs fundamentals. I learned quite a bit watching your videos. Keep up the good work!

  • @thawsitt
    @thawsitt 6 лет назад +19

    You only need 2 variables to store the last 2 fib values. The following code has

  • @davidranney8723
    @davidranney8723 4 года назад +4

    This is an excellent explanation. You chose a problem which is just complex enough to illustrate the technique. You methodically go through the steps and explain each step completely. I wish more tutorials were like this one. Well done!

  • @raghavendra2096
    @raghavendra2096 2 года назад +1

    I am following your data structures playlist and came across recursion where you mentioned dynamic programming and i came here.