×
Log in to StudySoup
Get Full Access to Math - Textbook Survival Guide
Join StudySoup for FREE
Get Full Access to Math - Textbook Survival Guide

Show that the greedy algorithm for making change for n

Discrete Mathematics and Its Applications | 7th Edition | ISBN: 9780073383095 | Authors: Kenneth Rosen ISBN: 9780073383095 37

Solution for problem 36E Chapter 3.3

Discrete Mathematics and Its Applications | 7th Edition

  • Textbook Solutions
  • 2901 Step-by-step solutions solved by professors and subject experts
  • Get 24/7 help from StudySoup virtual teaching assistants
Discrete Mathematics and Its Applications | 7th Edition | ISBN: 9780073383095 | Authors: Kenneth Rosen

Discrete Mathematics and Its Applications | 7th Edition

4 5 1 283 Reviews
21
0
Problem 36E

Show that the greedy algorithm for making change for n cents using quarters, dimes, nickels, and pennies has O(n) complexity measured in terms of comparisons needed.

Step-by-Step Solution:

Step 1</p>

In this problem, we are asked to show that the greedy algorithm for making change for n cents has O(n) complexity measured in terms comparisons needed.

Step 2</p>

The algorithm for making changes for n cents using quarters, dimes, nickels and pennies are

Procedure change

for i=1 to n

di=0

while

{is the number of coins of denominations ci }

Step 3 of 3

Chapter 3.3, Problem 36E is Solved
Textbook: Discrete Mathematics and Its Applications
Edition: 7
Author: Kenneth Rosen
ISBN: 9780073383095

Unlock Textbook Solution

Enter your email below to unlock your verified solution to:

Show that the greedy algorithm for making change for n

×
Log in to StudySoup
Get Full Access to Math - Textbook Survival Guide
Join StudySoup for FREE
Get Full Access to Math - Textbook Survival Guide
×
Reset your password