Assignment 08 - Greedy Algorithm

# Assignment 08 - Greedy Algorithm - until it is zero. 1....

This preview shows page 1. Sign up to view the full content.

COMP 271: Design and Analysis of Algorithms Fall 2007 Assignment 8 Assigned: 8/11/07 Due Date: 4pm, 15/11/07 Question 1 : In Hong Kong, coins are minted with denominations of 1, 2, 5, and 10 cents. Suppose there is a country where coins are minted with denominations of { d 1 , d 2 , . . . , d k } units. Consider the problem of making change of n units using the minimum number of coins. A greedy algorithm is to repeatedly use the biggest coin smaller than the amount to be changed
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: until it is zero. 1. Show that the greedy algorithm does not always give the minimum number of coins in a country whose denominations are { 1 , 6 , 10 } . 2. Shows that the greedy algorithm does give the minimum number of coins for Hong Kong. Notes : You can discuss homework question with your classmates, but you must write up your answers independently. Acknowledge the people with whom you have discussed the assignment. 1...
View Full Document

## This note was uploaded on 10/18/2009 for the course COMP 271 taught by Professor Arya during the Spring '07 term at HKUST.

Ask a homework question - tutors are online