0/1 Knapsack Problem easy explanation using Dynamic Programming. | Study Algorithms

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • Dynamic programming is probably the trickiest algorithmic paradigm to master. But that is what makes it essential as well. If you find a hard time understanding the 0/1 Knapsack problem using dynamic programming, this video is made for you. The video tries to explain the problem using a more relatable example from day to day life.
    This is a 2 part series.
    ➡️ Part 1:
    Discussion about the general idea of Dynamic Programming and how to generate a Fibonacci Series using DP.
    Watch the video here: • Dynamic Programming ea...
    ➡️ Part 2:
    00:00 - Intro
    00:43 - Explanation of the variation of a 0/1 Knapsack problem
    02:18 - Why do we call it 0/1?
    03:19 - Solving the problem using Dynamic Programming
    04:04 - A step by step demo
    14:57 - Why is dynamic programming beautiful?
    My favorite book on Introduction To Algorithms: amzn.to/35RrVuK
    📘 The description and examples are available at: studyalgorithms.com/theory/al...
    📚 More Algorithmic Paradigms:
    Brute Force: • Brute Force algorithms...
    Divide and Conquer: • Divide and Conquer alg...
    Greedy Algorithms: • Greedy Algorithms with...
    🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
    💻 Get Social 💻
    Follow on Facebook at: / studyalgos
    Follow on Twitter at: / studyalgorithms
    Follow on Tumblr at: / studyalgos
    Subscribe to RSS feeds: studyalgorithms.com/feed/
    #studyAlgorithms #programming #interview

Komentáře • 16

  • @tulas11
    @tulas11 Před rokem +1

    Couldn't be more easier! THANKS MAN!

  • @thellaidhinesh8646
    @thellaidhinesh8646 Před rokem

    What an explanation. You saved my day. now i got new perspective about dynamic programming. Thanks a lot bro. Keep the good work going

  • @rohand5545
    @rohand5545 Před 3 lety +2

    Tum bada mast kaam krte ho Maqsood bhai.🙏

  • @nehagoyal3325
    @nehagoyal3325 Před 4 lety +4

    Great video. I enjoyed dynamic programming for the first time.

    • @nikoo28
      @nikoo28  Před 4 lety +1

      Glad you enjoyed it!

  • @amanpaliwal2859
    @amanpaliwal2859 Před 3 lety +1

    Bhai, You are Awesome

  • @prateekagrawal6647
    @prateekagrawal6647 Před 3 lety

    Good work 👍👍👍

  • @pranaym143
    @pranaym143 Před 4 lety +2

    Great illustration

  • @anushreeyagurung293
    @anushreeyagurung293 Před rokem +2

    type at 13:54? When you add the fullness of the soup (400) + the fullness of the remanning 50 calories (100), its suppose to be 500 fullness which Is < 600. You wrote 400 + 100 = 600. which isn't a v big deal. just a heads up.

    • @nikoo28
      @nikoo28  Před rokem

      Thanks for pointing that out. I realised that typo after the video was already published.
      The solution will still remain unchanged though.

  • @Zashxq
    @Zashxq Před rokem

    wow this was the perfect explanation for me. i count calories so this was super relatable 😊 thank you for the video!

  • @sidramemon3274
    @sidramemon3274 Před rokem +1

    why don't we use the previous value from the same row? when we want to calculate the fullness value for 300 calories in a row of Fish we use 300+300=600. why not 300+400=700(400 from same row for 200 calories)?

  • @infinite639
    @infinite639 Před rokem

    bhai wahat is fullness
    i didnt understand

    • @nikoo28
      @nikoo28  Před rokem +2

      Understand fullness as the satisfaction level.
      Suppose that you are eating an apple pr eating a cake. Which one gives you more satisfaction?
      More the satisfaction, more is the fullness value.