[Solved]6 Assume N Kinds Available Coins Denominations L Al A2 Q37284647

6. Assume that there are n kinds of available coins. The denominations are l = al < a2 <· ·くan dollars, respectively, and each ai , 1 iSn is an integer. Your goal is to make change for m dollars using the fewest number of coins. Assume that you are using the following greedy approach: always choose the biggest denomination that is smaller than the remaining amount. For example, if m=68 and the coin denominations are 25, 10, 5, and I, then you would first choose two coins of 25, then one coin of IO, then one coin of 5, then three coins of 1 (68 2*25+1*101*5+3*1). The greedy approach in this example gave a solution with 7 coins. Give a set of denominations for which the greedy algorithm does not yield an optimal solution (solution with the fewest number of coins) for some m. Explain your answer by giving an example of m with an optimal solution and solution obtain by the greedy approach. Show transcribed image text 6. Assume that there are n kinds of available coins. The denominations are l = al
Expert Answer
Answer to 6. Assume that there are n kinds of available coins. The denominations are l = al < a2 ... . . .
OR

