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.

icon
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, data-structures-and-algorithms and related others by exploring similar questions and additional content below.