Programs to implement ef?ciently

Assignment Help Basic Computer Science
Reference no: EM13968218

1. Suppose we extend binomial queues to allow at most two trees of the same height per structure. Can we obtain O(1) worst-case time for  insertion  while retaining O(log N) for the other  operations?

2. Suppose you have a number of boxes, each of which can hold total weight and items i1, i2, i3, ... ,iN, which weigh w1, w2, w3, ... wN, respectively. The object is to pack all the items without placing more weight in any box than its capacity and using as few boxes as possible. For instance, if = 5, and the items have weights 2, 2, 3, 3, then we can solve the problem with two boxes.

In general, this problem is very hard, and no ef?cient solution is known. Write programs to implement ef?ciently the following approximation strategies:

a. Place the weight in the ?rst box for which it ?ts (creating a new box if there is no box with enough room). (This strategy and all that follow would give three boxes, which is suboptimal.)

b. Place the weight in the box with the most room for it.

c. Place the weight in the most ?lled box that can accept it without over?owing.

d. Are any of these strategies enhanced by presorting the items by weight?

Reference no: EM13968218

Questions Cloud

Blurred with the implementation of health policy : How does an informed consent become "blurred" with the implementation of health policy? Please provide an example and articulate this process
Provide reflections of what you have attempted to achieve : Provide some reflections of what you have attempted to achieve by means of your essay. You could, for example, explain how your essay sheds light on the broader controversy that it addresses.
Running time of insertion sort : 1. Sort the sequence 3, 1, 4, 1, 5, 9, 2, 6, 5 using insertion sort. 2. What is the running time of insertion sort if all elements are equal?
What would be the effect on the price of homes in houseville : What would be the effect of the following on the price of homes in Houseville : Houseville has just won an award for the most livable city in the United States. The publicity causes the demand curve for housing to shift rightward by 5,000 this yea..
Programs to implement ef?ciently : In general, this problem is very hard, and no ef?cient solution is known. Write programs to implement ef?ciently the following approximation strategies:
About express and implied warranties on products : In this module you have learned about express and implied warranties on products as well as what elements a plaintiff must prove in order to succeed in a products liability case. Is there a stated warranty or is it an implied warranty? If it is state..
Perform insert using binomial queues : Give an algorithm to build a binomial queue of N elements, using at most N - 1 comparisons between elements.  Propose an algorithm to insert M nodes into a binomial queue of N elements in O(M + log N) worst-case time. Prove your bound. Write an ef?ci..
Harge of writing the organizations code of ethics : You’ve proven yourself to the CEO of your company or organization on multiple occasions. To show her appreciation, she has put you in charge of writing the organization's code of ethics. There is likely going to be a promotion attached to this honor...
Legitimate-nondiscriminatory reason for its action : Craig applies for a job at Dispatch Transportation & Warehousing, Inc., for which he is well qualified. He passes a test to determine which applicants are eligible for hiring, but the employer discards the results, and Craig is rejected. Dispatch con..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  How have the legal authorities ruled on ssa decisions

How have the legal authorities ruled on SSA Decisions where the higher priced offer is challenged?

  How would this ip address be expressed

How many possible hosts would there be on the above network if all usable addresses were assigned (show your work)? d. How would this IP address be expressed using CIDR notation (show your work)? e. What is the range of the block of addresses this..

  Inherently insecure for sensitive professional

Networks are inherently insecure for sensitive professional and personal data. Still we use networks for sharing data. How to deal with protecting data in an insecure network environment that is the topic of discussion of this report. In this repo..

  Write a program and create a flow chart

The game of Nim. This is a well-known game with a number of variants. We will consider the following variants, which has an interesting winning strategy. Two players alternately take marbles from a pile.

  Prompt the user for the length and width of a lawn

Prompt the user for the length and width of a lawn

  The wbfk transport company operates throughout mainland

The WBFK Transport Company operates throughout mainland Australia. The company specialize in fast delivery of pallet-loads of goods from one WBFK depot to another WBFK depot. It does not do pickups at a customers premises nor does it deliver door to ..

  Identifying and describing how information is used

Write a 700- to 1,050-word paper identifying and describing how information is used and how it flows in an organization.

  Derive taylor polynomials of degree

Derive taylor's polynomials of degree n for: f(x) = (1+x)^(1/2) and f(x) = cos x. Find the approximate value of above functions at x = pi/4 by hand calculator upto two decimal points. Show steps.

  A full description of the new system

-A full description of the new system, a description of its components, and the benefit it will provide to Riordan

  Characteristics of the products being sold

Consider the retailers' objectives, the characteristics of the products being sold, and the type of customers who visit those sites answer

  Bubble sort, insertion sort, selection sort

As a new and eager employee of Google Tech; you've been asked by your employer to implement a sorting algorithm for inclusion in a package for a lucrative client.

  The consistency between all elements of the design

The consistency between all elements of the design

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