Subset sum problem | Tutorial on dynamic programming | Step by step guide

preview_player
Показать описание
Suppose you're given a sum let's say 10 and an array (9,3,7,11,5,6).
Now, you need to find subarray with given sum which is 10 in this case and this is known as subset sum problem which is also one of the classic computing problems.

************* A humble request ***************

Before you scroll further ensure that you subscribe to my channel Joey'stech and hit the bell icon so that you get notified when I upload a new video.
This will definitely help me to provide you free training content on programming and technology.

Continuing on the subset dum DP problem further you need to find out if there exists a subset from the array adding which you get the sum as 10.

In this subset sum example you can easily solve the problem simply by eyeballing and come up with a solution as (3,7) - 3 + 7 = 10

But the problem rises when the numbers in the array increase as well as the sum gets bigger. Then mere eyeballing wouldn't solve the problem. Only thing which
would then solve the problem is a proper subset sum problem solution algorithm written using Dynamic Programming technique

In this video of Joey'sTech you will learn to solve the subset problem in a magical way using DP.
We will fill the matrix together step by step and then will also find the components of the subset forming the given sum.

So keep watching and do subscribe.

Also find below videos of some of the classic dynamic programming problems solved on Joey'stech

Rod Cutting problem

01 Knapsack problem

Coin Change Problem
Рекомендации по теме
Комментарии
Автор

THank for your contribution. I am a newbie. I do not know how you com up with this solution. I know how and why it work but seem like i still dont understand it :(

codeoncloudtv
visit shbcf.ru