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

  Generate a recursive sequence

Given below is a small haskell function used to generate a recursive sequence. I'm getting a type error while using floor function. floor function is expecting RealFrac, I suppose. The code and error are given below.main = do

  Determine which cpu of the two is faster and why

From the first e-Activity, identify the following CPUs: 1) the CPU that resides on a computer that you own or a computer that you would consider purchasing, and 2) the CPU of one (1) other computer. Compare the instruction sets and clock rates of eac..

  Critical infrastructure protection

Critical Infrastructure ProtectionAccording to the text, Critical Infrastructure Protection (CIP) is an important cybersecurity initiative that requires careful planning and coordination in protecting our infrastructure.

  Company logo executive summary table of content

Group Portion Think of a business you would like to start. (I prefer Business name to be "World pre-owned Producers, Inc." Develop a business plan for your new business. The 4-6 page business plan must include the following: Company Logo Executive Su..

  Computing cycles to save if registers are available

Determine the number of cycles will be saved if both registers are available?

  What is it security auditing and what does it involve

What is IT Security Auditing. What does it involve. Why are Governance and Compliance Important

  Create a context diagram for the new billing system

Create a Context Diagram and a Diagram 0 for the new billing and payment system.

  Explain system recovery backups

On the left side of the website, click the STIGs Master List (A to Z) link. Scroll down the list to locate and then download the following Windows OS security guideline documents/zip files

  Identify how to change system settings

Identify at least 3 types of computers, how they process information, and the purpose and function of key hardware components.

  Why you think that the cio is this type of manager

Using the IT Savvy four types of the CIO (page 146 IT Savvy below), choose a type for each of CIO or IT leaders for the following 8 cases attached (Attachments 1-8).Give example of why you think that the CIO is this type of manager.

  Subsets of cardinality

Prove by induction that for every n >= 3, any set of cardinality n has exactly n(n-1)(n-2)/6 subsets of cardinality

  Develop a project proposal for an it project

The Individual Projects throughout this course will give you an opportunity to put into practice the Project Management concepts you are learning about. For the first week, your mission is to develop a project proposal for an IT project of your..

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