Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(3 points) Consider the problem of making change for n cents using the least number of coins. Describe a greedy algorithm to make change consisting
(3 points) Consider the problem of making change for n cents using the least number of coins. Describe a greedy algorithm to make change consisting of quarters, dimes, nickels, and pennies. Prove that your algorithm yields an optimal solution (3 points) Does your algorithm in part (b) give an optimal solution for any types of coin denominations di, d2,..., dk, for some integer k. Assume that each di is an integer and 1 is part of it. Note that part (b) has 4 types of coin denominations: 25, 10, 5, and 1. If your answer is yes then prove it, otherwise give a counter example
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