Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose you use a greedy algorithm to make change in the Kingdom of Hyrule. You have rupee gems worth 1 rupee, 4 rupees, 16 rupees

image text in transcribed

Suppose you use a greedy algorithm to make change in the Kingdom of Hyrule. You have rupee gems worth 1 rupee, 4 rupees, 16 rupees and 30 rupees What sequence of gems will you give someone if you owe them 37 rupees? Enter the denominations of rupee from first to last, using the values given above. If you do not need to use all of these rupees, enter a 0 for unused rupees. (For example, if you can make the given amount of change using only 4 rupees, enter 0 for #5 and #6) First rupee Second rupee Third rupee Fourth rupee Fifth rupee: Sixth rupee: Was this algorithm for making change optimal? Measure optimality in the sense of using the fewest number of rupees possible to make a given amount of change. (For example, using 4 one-rupee gems to make 4 rupees change is less optimal than using a single four-rupee piece.) Choose... >

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database In Depth Relational Theory For Practitioners

Authors: C.J. Date

1st Edition

0596100124, 978-0596100124

More Books

Students also viewed these Databases questions

Question

suggest a range of work sample exercises and design them

Answered: 1 week ago