Design an algorithm that implements the best-fit heuristic

Assignment Help Basic Computer Science
Reference no: EM131361962

In the bin-packing problem, we are given n metal objects, each weighing between zero and one kilogram. Our goal is to find the smallest number of bins that will hold the n objects, with each bin holding one kilogram at most.

• The best-fit heuristic for bin packing is as follows. Consider the objects in the order in which they are given. For each object, place it into the partially filled bin with the smallest amount of extra room after the object is inserted.. If no such bin exists, start a new bin. Design an algorithm that implements the best-fit heuristic (taking as input the n weights w1, w2, ..., wn and outputting the number of bins used) in O(n log n) time.

• Repeat the above using the worst-fit heuristic, where we put the next object in the partially filled bin with the largest amount of extra room after the object is inserted.

Reference no: EM131361962

Questions Cloud

The value of critical thinking : Give your opinion on whether being an effective critical thinker makes decision making easier or more challenging. Justify your response - Explain the fundamental ways in which effectively applying critical thinking concepts has helped you to become..
Evaluate the effectiveness of the organizations hr policies : Imagine that you are the Director of the HR Department at your current organization or an organization with which you are familiar. You are responsible for delegating duties to your team for the selection, development, and management of both the n..
Develop an action plan to share with the hospital staff : Develop an action plan to share with the hospital staff and CDC local office to address and contain the outbreak in an effective and efficient manner at the hospital
Blood pressure measured with the person sitting upright : a. What are the two separate fluid systems when a cuff is used measure a person's blood pressure? Are the two systems connected, and if so, how? b. Using a cuff around the upper arm, why is blood pressure measured with the person sitting upright?
Design an algorithm that implements the best-fit heuristic : In the bin-packing problem, we are given n metal objects, each weighing between zero and one kilogram. Our goal is to find the smallest number of bins that will hold the n objects, with each bin holding one kilogram at most.
Examine the pros from the perspective of crestview hospital : Examine the pros and cons from the perspective of Crestview Hospital of the placement of its new billboard directly adjacent to Briarwood Medical Center.
Complete a research-driven formal business report : Complete a 1,000- to 1,250-word Research-Driven Formal Business Report that proposes a change to the workplace or proposes a new initiative using the components of ethical business communication.
Description of the big bang : Q.1. Give a brief (just a few lines) description of the big bang. What does it predict? What doesn't it predict? A little history would be nice here. Please cite any references you use.
What are the various leading companies in the industry : Are there any new entrants in the marketplace? Is this industry heavily regulated? What are the various leading companies in the industry? How long have they been in the market?

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  Discuss the positive and negative aspects of a computed case

We call a statement in any language a compute d case type of statement if it branches to one of several areas in the program, depending on the value of a variable. Discuss the positive and negative aspects of a computed case statement. In particul..

  What is the value of the symmetric key

In the Diffie-Helman protocol, what happens is x and y have the same value, that is, Alice and Bob accidentally chosen the same number?

  Specify all integrity constraints

Create an ER diagram, and specify all integrity constraints. If some information is missing, suggest additional assumptions and briefly explain their rationale.

  Analyst determine the impact

Will different sectors respond differently to macro events? How can analyst determine the impact?

  How the technology creates or contributes to the problem

Choose one ethical issue arising from the use of ICT that has been reported in the press in the last one year, and discuss it in depth. Show why or how the technology creates or contributes to the problem.

  Concepts of statistical process control

Explain the concept of the Taguchi loss function. Link your answer to the concepts of statistical process control. This answer must be in your own words-significant cut and paste from the text or other sources is not acceptable.

  Detection software automatically analyzes network traffic

What detection software automatically analyzes all network traffic. Assesses system vulnerabilities, recognizess any unauthorized access (intrusions).

  Service provider-selected applications

How does the model change with third party applications from service provider-selected applications? You will have to do some research and I would recommend that you visit or call a marketing individual within each organization to help with your q..

  What are difference between oop and object orinted design

What is the difference between object oriented programming and object oriented design

  Convert a regular expression to an nfsm

Given a regular expression r over the set Σ, there is a nondeterministic finite-state machine that accepts the language denoted by r.

  Give the corresponding diagram for decryption

Give the corresponding diagram for decryption.

  Derive this relationship by using euler’s theorem

Verify that Euler's Theorem holds in Zm, m = 6,9, for all elements a for which gcd(a,m) = 1. Also verify that the theorem does not hold for elements a for which gcd(a,m) ≠ 1.

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