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

  The tblmaginfo table contains three fields

The tblMagInfo table contains three fields. The Code and Cost fields are numeric. The Magazine field contains text. The dataset's name is MagsDataSet.

  Rewrite code especially for each type of hardware platform

Portability is the ability of software to move easily from one hardware platform to another. UNIX was the first portable operating system, allowing programs to compile on multiple hardware platforms without the need for the programmer to rewrite code..

  Estimate the roof temperature under steady-state conditions

Explain qualitatively the effect of changes in the absorptivity, emissivity, and convection coefficient on the steadystate temperature.

  Create a bus matrix based

Imagine that you are a senior data warehouse architect for LECAL Corporation.  Your company has been contracted by the U.S. Department of Education to develop a data warehouse which will track student performance on a series of planned nationwide ..

  Give the forwarding tables for each of the bridges

As in the previous problem, consider the arrangement of learning bridges shown in Figure 3.38. Assuming all are initially empty, give the forwarding tables for each of the bridges B1-B4 after the following transmissions:

  Importance of employees for a company

Given the importance of employees for a company to sustain a competitive advantage, why do you think so many companies have engaged in layoffs, outsourcing, and off-shoring of work to other countries? 200 Words!!!!!

  How would we change our plot bml grid () function to allow

How would we change our plot BML Grid () function to allow

  Determining the operations security practices

Operations security includes many procedural activities each day. Provide examples to secure facilities that house systems that process sensitive information.

  Technology and organizational behavior issues

You are to write a three to four (3-4) page paper that answers the following: During the 1970s, the U.S. Air Force Program for Integrated Computer-Aided Manufacturing (ICAM) sought to increase manufacturing productivity through systematic applicat..

  Question regarding the four brake drums

A 1500-kg car, travelling at 108-km/hr, is pulled over in an 80-km/hr zone. What is the temperature rise in each of the four brake drums? (Each of the four iron brake drums weigh 8.0-kg and the specific heat of iron is 448-J/k

  Write the definition of a function named addmoney

Now write the definition of a function named addMoney that receives two Money arguments and returns their sum, in normalized form. So if the equivalent of $1.85 and $2.19 is passed the function would return the equivalent of $4.04.

  Database administrator for department store

The Strayer Oracle Server may be used to test and compile the SQL Queries developed for this assignment. Your instructor will provide you with login credentials to a Strayer University maintained Oracle server.

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