@@ -0,0 +1,2142 @@
+// A Dynamic Programming based program to find%0A// minimum of coins to make a given change V %0Aimport java.io.*; %0A  %0Aclass min_coins%0A%7B %0A    // m is size of coins array (number of different coins) %0A    static int minCoins(int coins%5B%5D, int m, int V) %0A    %7B %0A        // table%5Bi%5D will be storing the minimum number of coins %0A        // required for i value. So table%5BV%5D will have result %0A        int table%5B%5D = new int%5BV + 1%5D; %0A  %0A        // Base case (If given value V is 0) %0A        table%5B0%5D = 0; %0A  %0A        // Initialize all table values as Infinite %0A        for (int i = 1; i %3C= V; i++) %0A        table%5Bi%5D = Integer.MAX_VALUE; %0A  %0A        // Compute minimum coins required for all %0A        // values from 1 to V %0A        for (int i = 1; i %3C= V; i++) %0A        %7B %0A            // Go through all coins smaller than i %0A            for (int j = 0; j %3C m; j++) %0A            if (coins%5Bj%5D %3C= i) %0A            %7B %0A                int sub_res = table%5Bi - coins%5Bj%5D%5D; %0A                if (sub_res != Integer.MAX_VALUE  %0A                       && sub_res + 1 %3C table%5Bi%5D) %0A                       table%5Bi%5D = sub_res + 1;     %0A            %7D %0A        %7D %0A        return table%5BV%5D; %0A    %7D %0A  %0A    // Driver program  %0A    public static void main (String%5B%5D args)  %0A    %7B %0A        int coins%5B%5D = %7B1, 5, 10, 25, 50%7D;  %0A        int m = coins.length; %0A        int V = 199; %0A        if(m %3C= 0)%0A        %7B%0A            System.out.println(%22Must have some coin denominations%22);%0A        %7D%0A        else%0A        %7B%0A            System.out.print( %22Minimum number of coins required to make %22 + V + %22 using %22);%0A            if(m %3E 2)%0A            %7B%0A                for (int i = 0; i %3C m-1; i++)%0A                %7B%0A                    System.out.print (%22%22 + coins%5Bi%5D + %22, %22);%0A                %7D%0A                System.out.print (%22and %22 + coins%5Bm-1%5D + %22 %22);%0A            %7D%0A            else%0A            %7B%0A                if(m == 1)%0A                    System.out.print(coins%5B0%5D + %22 %22);%0A                if(m == 2)%0A                    System.out.print(coins%5B0%5D + %22 and %22 + coins%5B1%5D + %22 %22);%0A            %7D%0A            System.out.println(%22is %22 + minCoins(coins, m, V) + %22 coins.%22); %0A        %7D%0A    %7D%0A%7D %0A

Create min_coins.java