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

  Create a script that presents a movie guessing game

create a script that presents a Movie guessing game. Allow the users to guess the best picture award from last year. Allow them to guess the word letter-by-letter by entering a character in a form.

  What these three things(rob, rs, rsr) explain

What these three things(ROB, RS, RSR)  explain  ?

  Calculate how many disk i/o operations are required

Consider a file currently consisting of 100 blocks. Assume that the filecontrol block (and the index block, in the case of indexed allocation) is already in memory.

  Design a tick tac toe game

Design a Tick Tac Toe Game. You must use Arrays to represent the board You may use Pointers

  Extract the sales data and can produce any of the reports

Write a menu-driven program that uses your function from the previous question to extract the sales data and can produce any of the following reports

  How are you connected to your isp

Tell me about your home network. How are you connected to your ISP? How many computers do you have connected to your router? Do you have your devices connected wirelessly? Do you have any devices connected with wire? Do you have any network e..

  Determine if the given subset is a subspace

Determine if the given subset is a subspace of the given vector space. Prove your claim - Is the set P of all polynomials of the form p(x) = a+x2, with a ? R, a subspace of P2?

  Design and implement a graphical user interface (gui)

Design and implement a graphical user interface (GUI) that lets a user draw geometric objects such as rectangles, circles or line segments. The geometric objects are two be "entered" with clicks of the mouse

  Major information security threats

Write a 3-to 4-page paper on at least three major information security threats that a specific organization you choose faces today. This portion of the assignment should provide a foundation for the sections to be added in Weeks 3 and 4

  Develop a design plan and schedule detailing

Develop a design plan and schedule detailing your plans for the next 4 weeks in order to deliver the tasks specified. This should cover what design decisions must be made and who should make them; what tasks must be performed and in what order; ho..

  Draw external view diagram by compiling all inputs-outputs

Draw the external view diagram by compiling all inputs and outputs from these four functional diagrams Draw the internal view diagram by compiling all info processors and info sores from these four functional diagrams.

  Who swallowed a cat, imagine that to swallow a cat.

There was an old woman who swallowed a fly. I don't know why she swallowed that fly, Perhaps she'll die. There was an old woman who swallowed a spider, That wriggled and wiggled and jiggled inside he She swallowed the spider to catch the fly, I do..

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