M
Explanation by: Mr. Dubey
using the greedy algorithm, three coins {4,1,1} will be selected to make a sum of 6. but, the optimal answer is two coins {3,3}. similarly, four coins {4,4,1,1} will be selected to make a sum of 10. but, the optimal answer is three coins {4,3,3}. also, five coins {4,4,4,1,1} will be selected to make a sum of 14. but, the optimal answer is four coins {4,4,3,3}. for a sum of 100, twenty-five coins {all 4’s} will be selected and the optimal answer is also twenty-five coins {all 4’s}.
You must be Logged in to update hint/solution
Be the first to start discuss.
Related MCQs
Q. If a thread invokes the exec system call
Q. Recursion is a method in which the solution of a problem depends on
Q. What does dimensionality reduction reduce?
Q. change the state of thread from suspe
Q. Run time mapping from virtual to physical address is done by
Question analytics

Discusssion
Login to discuss.