Solved–Assignment VI– Solution

$30.00 $19.00

Given a list of N coins, their values (V1, V2, … , VN), and the total sum S. Write a dynamic programming to find the minimum number of coins the sum of which is S (we can use as many coins of one type as we want), or report that it’s not possible to select…

You’ll get a: . zip file solution

 

 

Description

5/5 – (2 votes)
  1. Given a list of N coins, their values (V1, V2, … , VN), and the total sum S. Write a dynamic programming to find the minimum number of coins the sum of which is S (we can use as many coins of one type as we want), or report that it’s not possible to select coins in such a way that they sum up to S. When solution is possible also provide exact number of coins of each denomination.

Upload file Assignment6A.c

  1. You have to enter into puzzler’s house. Puzzler’s house contains (m*n) numbers of rooms. Where m is the number of rows and n is the number of columns. Rooms are arranged in m by n matrix like structure. Your want to reach room (m,n) starting from room (0,0) in minimum cost. There is a cost associated with every room (take it as input). You are allowed to move downward, rightward or diagonally. For example from room (i,j) you can reach to room (i+1,j) or (I,j+1) or (i+1,j+1). Write a dynamic programming to find out the total minimum cost and the required move at each step.

Example Input:

Value of m=4 and n =3 and cost corresponding to each room is given in matrix format

row

column

0

1

2

0

1

2

4

1

10

5

7

2

12

9

3

3

6

4

7

Output:

Total cost: 1+5+3+7=16

Move: diagonal, diagonal, downward

Upload file Assignment6B.c

  1. You have a set of n integers. Write a dynamic programming which finds two sets (Set1 and Set2) from these n integers such that it minimizes difference between |Sum(Set1) – Sum(Set2)|, where Sum(S) denotes sum of all elements belong to set S.

Upload file Assignment6C.c