Suppose we need to make change for n cents, and we want to use the least number of coins of denominations 1, 10, and 25 cents. Consider the following greedy strategy: suppose the amount left to change is m. Take the largest coin that is no more than m, subtract this coin's value from m, and repeat. Prove that this algorithm is optimal, or give a counterexample if it is not.
+5
Answers (1)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Suppose we need to make change for n cents, and we want to use the least number of coins of denominations 1, 10, and 25 cents. Consider the ...” in 📙 Mathematics if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Home » Mathematics » Suppose we need to make change for n cents, and we want to use the least number of coins of denominations 1, 10, and 25 cents. Consider the following greedy strategy: suppose the amount left to change is m.