Design greedy algorithm for making change after someone buys

Assignment Help Computer Engineering
Reference no: EM131841653

Problem

Design a greedy algorithm for making change after someone buys some candy costing x cents and the customer gives the clerk $1. Your algorithm should try to minimize the number of coins returned.

a. Show that your greedy algorithm returns the minimum number of coins if the coins have denominations $0.25, $0.10, $0.05, and $0.01.

b. Give a set of denominations for which your algorithm may not return the minimum number of coins. Include an example where your algorithm fails.

Reference no: EM131841653

Questions Cloud

Calculate what is the running time of your algorithm : Give an efficient algorithm for determining if a pattern P is a subsequence (not substring) of a text T. What is the running time of your algorithm?
Reflective paper on class-status-power-ethnicity : Choose ONE topic from the following: class, status, power, ethnicity, age or gender. You can use imagery/creative medium to reflect on their role
What should rutherford do now : What conclusions do you reach? Is there evidence of discrimination in promotion decisions?
Write a reflective paper highlighting using the format : Choose ONE topic from the following: class, status, power, ethnicity, age or gender. You can use imagery/creative medium to reflect on their role as health
Design greedy algorithm for making change after someone buys : Design a greedy algorithm for making change after someone buys some candy costing x cents and the customer gives the clerk $1.
Internal and external response to the bribery charges : How would you characterize Walmart's internal and external response to the bribery charges?
Calculate the number of jovian days in one jovian year : a). Calculate the number of jovian days in one jovian year b). Verify by calculation the magnitude of the synodic period of Pluto
How many books must be sold to break even : A book publisher has fixed costs of $360,000 and variable costs per book of $11.00. The book sells for $27.00 per copy.
Define the edit distance between two strings x and y : Define the edit distance between two strings X and Y of length n and m, respectively, to be the number of edits that it takes to change X into Y.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Recognize trends in mobile software development and

imagine you are employed as a senior software engineer in a company that designs and produces mobile software

  Patent strategy contributing to succes of technology venture

Describe the ways by which an effective patent strategy contributes to success of technology venture? Answer should include at least 300 words. Also include references.

  Calculate the average surface temperature of the head

An average person generates heat at a rate of 240 Btu/h while resting in a room at 70°F. Assuming one quarter of this heat is lost from the head.

  Read the case study titled a patient information system

read the case study titled a patient information system for mental health care located in chapter 1 of your textbook.

  What qualities might jim possess that would make him a

jim watanabe the assistant director of information technology at petries electronics a southern california-based

  Sapient is an international company based in massachusetts

sapient is an international company based in massachusetts. it has developed a unique and innovative agile methodology

  What are the feelings positive or negative

IT administrators in small companies must often execute several functions at the same time like network administrator, database administrator, user consultant and others. Compared to their situation, their colleagues in larger companies can get mo..

  Define how architectural and protocol changes occur

express how architectural and protocol changes occur, the administrative organization that oversees the technical development of the Internet, and the process that each protocol must undergo to become an Internet Standard.

  Make use of a regularexpressionvalidator control

make Use of Visual Studio.NET 2005 to create an ASP.NET project with four aspx forms. Use Master Pages to display a company name selected by your group at the top each form.

  Express limitations and current research trends in the area

Autonomous (intelligent) software agents are used in Artificial Intelligence to solve an increasing number of complex problems. explain their main applicability as well as their advantages, limitations and current research trends in the area.

  Quantifying the software development

This organization is interested in quantifying its software development. Write down a report proposing suitalbe metrics and propose how these can be collected.

  Why the analysis step often breaks down

It is said that communications in the analysis step often breaks down? Could you comment on this? Have you experienced this phenomenon? If not, will you accept this statement, and why.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd