Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started