Assume that you were given N cents (N is an integer) and you were asked to break up the N cents into coins consisting of 1 cent, 2 cents, and 5 cents. Prove that a greedy algorithm always gives the optimal solution
Assume that you were given N cents (N is an integer) and you were asked to break up the N cents into coins consisting of 1 cent, 2 cents, and 5 cents. Prove that a greedy algorithm always gives the optimal solution
Related questions
Question
Assume that you were given N cents (N is an integer) and you were asked to break up the N cents into coins consisting of 1 cent, 2 cents, and 5 cents.
Prove that a greedy algorithm always gives the optimal solution.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps