Suppose we live where there are coins for 1 4 and 6 units


Suppose we live where there are coins for 1, 4, and 6 units, and we have to make change for 8 units. Show the solution of this problem by dynamic programming

Hint: Find the formula of c[i, j], which is the minimum number of coins required to pay an amount of j units. 1≤i≤n is the denomination and i have value di units, 0≤j≤N is the amount of units. Then set up a table for c[1..n, 0..N]

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Suppose we live where there are coins for 1 4 and 6 units
Reference No:- TGS01540047

Now Priced at $10 (50% Discount)

Recommended (95%)

Rated (4.7/5)