Question: Explain your reasoning and show calculations / steps , please. This task is known as the coin change problem. Given the currency denominations for Norwegian

Explain your reasoning and show calculations/steps, please. This task is known as the coin change problem.
Given the currency denominations for Norwegian krone coins C={1,5,10,20}, we devise a greedy
algorithm to give change while using the fewest number of coins possible.
When returning an amount V, we will give a coin of the largest value possible that does not take
us over the amount we have left to pay, and repeat so until we reach V.
a) Is this algorithm optimal?
b) Suppose we introduce a 7 kroner coin. Is the algorithm still optimal?
 Explain your reasoning and show calculations/steps, please. This task is known

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!