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, 6 cents and 7 cents. Prove that a greedy algorithm may not always give 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, 6 cents and 7 cents. Prove that a greedy algorithm may not always give 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, 6 cents and 7 cents.
Prove that a greedy algorithm may not always give 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 3 steps