問題詳情

15. Consider the problem of making change for n cents using the fewest number of coins. An algorithm to solve this problemis to give the coin with the highest available denomination without going over, and repeat the process until the amount ofremaining change drops to O. Which of the following sets of available coin denominations would cause this algorithm tofail at yielding an optimal solution?
(A) {1,3}
(B) {1,3,4,5}
(C) {1,5,10, 25}
(D) {c0,c1,..,..ck) for any set of integers c > 1 and k ≥1

參考答案

答案:[無官方正解]
難度:計算中-1
書單:沒有書單,新增