Implement efficiently the given approximation strategies

Assignment Help Data Structure & Algorithms
Reference no: EM131667245

Question: Suppose that you have a number of boxes, each of which can hold total weight 1.0 and items i1, i2, i3, ..., iN, which weigh w1, w2, w3, ..., wN, respectively. The object is to pack all the items, using as few boxes as possible, without placing more weight in any box than its capacity. For instance, if the items have weights 0.4, 0.4, 0.6, and 0.6, you can solve the problem with two boxes. This problem is difficult, and no efficient algorithm is known. Several strategies give good, but not optimal, packings. Write programs to implement efficiently the following approximation strategies.

a. Scan the items in the order given; place each new item in the most-filled box that can accept it without overflowing. Use a priority queue to determine the box that an item goes in.

b. Sort the items, placing the heaviest item first; then use the strategy in part (a).

Reference no: EM131667245

Questions Cloud

Calculate the gross pay of an employee : Write a program to calculate the gross pay of an employee based on the number of hours worked and rate of payment - Write a program to take two numbers
Create a use case diagram for the urp approval form system : List 2 considerations to help you define your actors at an appropriate level. List 2 considerations to help you define your scenarios appropriately.
Produce a literature review : For this assignment, you are going to locate an alternate resource that provides you with information on how to produce a literature review
Write a matlab script to calculate the speed of the rocket : Write a MATLAB script to calculate the height (metres) and the speed (metres/s) of the rocket over flight-time. Plot these results against time using two graph.
Implement efficiently the given approximation strategies : For instance, if the items have weights 0.4, 0.4, 0.6, and 0.6, you can solve the problem with two boxes. This problem is difficult, and no efficient algorithm.
Developing professional image in chosen career field : Describe three characteristics that are key to developing your professional image in your chosen career field. Support your response and include.
Does she betray hamlet at any time : Does she betray Hamlet at any time? Does she believe Hamlet when he tells her that Claudius has killed Old Hamlet? Does she betray Denmark?
Laboratory and radiology services : Scenario: You have been invited to be a member of a PI team on improving patient wait times for laboratory and radiology services.
Research the subject of plagiarism : Using at least 3 high-quality sources (i.e., do not use "shortcut sites," wikis, or sources that may be unreliable), research the subject of plagiarism.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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