How to process such a drug order of k requests

Assignment Help Computer Engineering
Reference no: EM132139027

Question :

Suppose you are asked to automate the prescription fulfillment system for a pharmacy, MailDrugs. When an order comes in, it is given as a sequence of requests, "x1 ml of drug y1," "x2 ml of drug y2," "x3 ml of drug y3," and so on, where x1 < x2 < x3 < ··· < xk.

MailDrugs has a practically unlimited supply of n distinctly sized empty drug bottles, each specified by its capacity in milliliters (such 150 ml or 325 ml).

To process a drug order, as specified above, you need to match each request, "xi ml of drug yi ," with the size of the smallest bottle in the inventory than can hold xi milliliters.

Describe how to process such a drug order of k requests so that it can be fulfilled in O(k log(n/k)) time, assuming the bottle sizes are stored in an array, T, ordered by their capacities in milliliters.

Reference no: EM132139027

Questions Cloud

Discuss about the multidimensional partitioning approach : Suppose that an application has M input variables and that each variable partitions the input space into N equivalence classes.
Critically review the statement on corporate governance : HC1010 Group Assignment Question - Finally, you are required to visit the company's website and critically review the statement on corporate governance
What is the second message : What is the main advantage of first distributing a session key and then using symmetric-key cryptography rather than using public-key.
What does the super keyword represents : What does the super keyword represents and where can it be used? Give an example of a superclass and subclass.
How to process such a drug order of k requests : MailDrugs has a practically unlimited supply of n distinctly sized empty drug bottles, each specified by its capacity in milliliters (such 150 ml or 325 ml).
Do you think radix exchange sort is good for this case : Since it is just a one-year-old company, the inventory database now contains only 2000 distinct product codes, in the range from 1 to 3000.
Write a method to create two instances of this bowler class : The Bowler class has two fields, a full name and a high score. Write the main() method to create two instances of this Bowler class.
Summary on hypertext transfer protocol : Summary on Hypertext Transfer Protocol (HTTP) describing its major features, principles of operation and application in transferring traffic.
Describe how to process such a drug order of k requests : Describe how to process such a drug order of k requests so that it can be fulfilled in O(k log(n/k)) time, assuming the bottle sizes are stored.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Calculate the graphics processing power needed

Calculate the graphics processing power needed, in million arithmetic operations per second, for this particular application.

  Write algorithm in pseudocode for the fermat primality test

The square-and-multiply fast exponentiation algorithm can also be designed to test. Write an algorithm in pseudocode for the Fermat primality test.

  What changes will need to be made to the other methods

What changes will need to be made to the other methods for linked stacks? Discuss the advantages and disadvantages of this modification.

  Big data is a term used to describe the voluminous amount

big data is a term used to describe the voluminous amount of structured and semi-structured data generated by

  Define an iterated cryptographic hash function

Define an iterated cryptographic hash function. Define a cryptographic hash Function. Describe the idea of the Merkle-Damgard scheme.

  List and describe down the components of a data center

List and describe down the components of a data center. What did you learn in this process and how will this practice be applicable to your real world career?

  Explain effect of a router on delimiting broadcast traffic

describe local area network (LAN) capabilities and characteristics, such as network type, internet protocol (IP) addressing, switch or hub operation

  Write a program called a2p1 to run in the lc-3 simulator

Write a program called A2P1 to run in the LC-3 simulator. The program asks for the user to type in his or her UPI. Then the program asks for the age of the user and prints the UPI out that many times.

  What does acf plot tell us about regression models forecasts

What does the ACF plot tell us about the regression model's forecasts? How can this information be used to improve the model?

  What does it mean to rank goals in gp

What does it mean to rank goals in GP? How does this affect the problem's solution? What kinds of constraints would you include in your model?

  Write a program that can be used to convert meters

Write a program that can be used to convert meters to feet and inches. Allow the user to enter a metric meter value in a method.

  Do people always value freedom more than justice

Would you prefer a class in which 10 percent get A's and everyone competes for grades or a class in which everyone gets a ‘Pass' and students help.

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