Quantcast
Channel: programing – 100% Private Proxies – Fast, Anonymous, Quality, Unlimited USA Private Proxy!
Viewing all articles
Browse latest Browse all 8

Minimization of amount in the change coins problem using the dynamic programing approach

$
0
0

I’m learning the dynamic programming approach to solve the coins change problem, I don’t understand the substitution part

Given: amount=9, coins = [6,5,1],

the instructor simplified it with this function:

minCoins = min {(9-6)+1 , (9-5)+1, (9-1) +1} = min{4, 5, 9} = 4

I don’t understand the logic of this min method: why we say that to change amount of 9 coins, we can simply, take the minimum of: 9 – {all coins} +1 ?

here’s a Gif that visualizes the instructor’s approach: https://i.stack.imgur.com/Zx2cG.gif

(*taken from the Algorithmic Toolbox course/ instructor: Prof. Pavel A. Pevzner)

The post Minimization of amount in the change coins problem using the dynamic programing approach appeared first on 100% Private Proxies - Fast, Anonymous, Quality, Unlimited USA Private Proxy!.


Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images