Give an instance of the making-change problem

Assignment Help Computer Engineering
Reference no: EM132139791

Question :

Suppose that the coins of the fictional country of Combinatoria come in the de- nominations, d1, d2, . . . , dk, where d1 = 1 and the other di values form a set of distinct integers greater than 1. Given an integer, n > 0, the problem of making change is to find the fewest number of Combinatorian coins whose values sum to n.

(a) Give an instance of the making-change problem for which it is suboptimal to use the standard greedy algorithm, which repeatedly chooses a highest-valued coin whose value is at most n until the sum of chosen coins equals n. (writeup only)

(b) Implement the algorithm for the coin changing problem. Take as input a file with a set of denominations. Interactively ask the user for the amount he wants to make change for and print the number of coins and the actual change.

Reference no: EM132139791

Questions Cloud

Fifty-seven percent of employees make judgements : Fifty-seven percent of employees make judgements about their co-workers based on the cleanliness of their desk.
Test scores on the law school admission test : What is the probability that the mean of 12 randomly selected scores is less than 161?
For which values of n does insertion sort beat merge sort : For inputs of size n, insertion sort runs in 8n2 steps, while merge sort runs in 64nlgn steps.
Calculate the project initial investment costs : Calculate the project's initial investment costs, annual incremental operating cash flows, and terminal cash flows. What are project's NPV and IRR
Give an instance of the making-change problem : Give an instance of the making-change problem for which it is suboptimal to use the standard greedy algorithm.
What is the probability that at least : If you select 31 customers, what is the probability that at least 20 of them have looked at their score in the past six months?
Discuss about the computer security consulting services : Determine whether you would employ a hierarchical, a flat, or a matrix organizational structure, and explain why.
Show your structure before and after the deletion : A B+ tree in which the deletion of the value 42 leads to a redistribution. Show your structure before and after the deletion.
What is the cutoff score for the top : Students scoring in the top 18% get an A. What is the cutoff score for the top 18% in this example?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Developing the java program

The Java String class explains the following method in order to split a Java String object into several fragments of the substrings and store them in a returned String array.

  How many attempts on average are needed to find two persons

Ignoring the birth month, how many attempts, on average, are needed to find two persons with the same birth date? Assume that all months have 30 days.

  Write down a program to request a person''s age

In order for exercise to be beneficial to cardiovascular system, heart rate (number of heart beats per minute) must exceed a value called the training heart rate.

  Program to perform a series of complicated calculation

An engineer needed a program to perform a series of complicated calculations. He found a computer programmer capable of writing the program

  Agile method of software development

Explain the Scrum method as it relates to the software development process - Explain where the software architecture process fits into the Agile method of software development.

  Summarise the top three tutorials for tools you deem ideal

Create an essay (350-500 words) in which you summarise the top three tutorials for tools you deem ideal for creating your Group Project's blog-based website

  Discuss specific current enterprise strategic requirements

Discuss the specific current or future enterprise strategic requirements that could benefit from the emerging technologies. Discuss the potential benefits.

  Which sniffer tool is designed to intercept passwords

Which sniffer tool is designed to intercept and reveal passwords? Which of following is an application-level scanner? Who originally designed and created Linux?

  Prepare a project proposal for anc and maternity tracker

Prepare a Project Proposal for ANC and Maternity tracker. Here, details such as mode of delivery, Apgar score, weight of the baby, conditions of both mother and child at discharge will all be captured.

  Improve the transient response

What difference on the s-plane is noted between using a PD controller or using a lead network to improve the transient response?

  How are ip addresses used for communication purpose

How are IP addresses used for communication purpose over the internet. what are some of the future challenges faced with using IPv6

  Discuss the pros and cons of the two approaches

Discuss the pros and cons of the two approaches. The issues you should consider, among other& are efficiency (disk space and access time).

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