Question: a. Write pseudocode (or actual code) of a greedy algorithm for the change-making problem with an amount n and coin denominations d_1 > d_2 >
a. Write pseudocode (or actual code) of a greedy algorithm for the change-making problem with an amount n and coin denominations d_1 > d_2 > ... > d_m as its input. Assume that the number of coins of each denomination d_i is unlimited. The code should simply determine the minimum number of coins that sum up to n (don't worry about which change is required).
b. What is the asymptotic efficiency of your algorithm?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
