Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider a post office that sells stamps in k different denominations c 1 < c 2 < c 3 < . . . < ck
Consider a post office that sells stamps in k different denominations c c
c ck
all positive integers. The problem is to find the smallest set of stamps
that total to a given cost n We have a greedy algorithm to do this, which uses the
highest value stamp that doesnt exceed the remaining amount, subtracts its value
from the remaining amount, and repeats until the remaining amount reaches zero.
Find a case where this algorithm fails.
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