subject
Business, 01.07.2020 16:01 drandbone92

Suppose that a system to process requests has several queues, one for each customer service representative that is currently working. Each request has at least the following attributes: public class Request implements Comparable{ String description; String timestamp; ) where its compare to method compares requests based on their timestamp. The Queue class implements the usual enqueue (Request. item), dequeue (), get. Size(), and isEmpty() methods. Suppose that you have access to three queues initially declared as: Queue 91 = new QueueO; Queue 92 = new Queue(); Queue q3 = new Queue(); which represent the requests to be processed by three customer service representatives.
Suppose that one of the customer service representatives is no longer available, so the requests stored in 91, 92, and q3 must be divided as evenly as possible into two queues (p1, p2) according to their time stamps. Example: The following three queues: 91->("r9483","15;03"), ("r2532","13:55"), ("r8431","10:40") 92-> ("r3452","16:03"), ("r5234","14:05"), ("r1432","11:50") 93-> ("r3837","14:35"), ("r8742","13:10") are now divided into the following two queues: p1 -> ("r9483","15;03"), ("r5234","14:05"), ("r8742","13:10"), ("r8431","10:40") P2 -> ("r3452","16;03"), ("r3837","14:35"), ("r2532","13:55"), ("r1432","11:50") The way that this works is to move elements from the original queues to the destination ones alternating destinations, i. e. from the three dequeued elements from 91, 92, and q3, enqueue the one with the earliest time into queue p1, then from the three dequeued elements from 91, 92, and q3, enqueue the one with the earliest time into queue p2, then from the three dequeued elements from 91, 92, and q3, enqueue the one with the earliest time into queue p1, then back to p2, and keep repeating until 1, 42, and q3 are empty. Write java code to do this. Make sure to declare your queues p1 and p2.

ansver
Answers: 2

Another question on Business

question
Business, 21.06.2019 19:20
Which of the following best explains why large companies have an advantage over smaller companies? a. economies of scale make it possible to offer lower prices. b. the production possibilities frontier is wider for a larger company. c. decreasing marginal utility enables more efficient production. d. increasing the scale of production leads to a reduction in inputs.2b2t
Answers: 1
question
Business, 21.06.2019 22:10
You have just received notification that you have won the $2.0 million first prize in the centennial lottery. however, the prize will be awarded on your 100th birthday (assuming you're around to collect), 66 years from now. what is the present value of your windfall if the appropriate discount rate is 8 percent?
Answers: 1
question
Business, 22.06.2019 03:00
Compare the sources of consumer credit 1. consumers use a prearranged loan using special checks 2. consumers use cards with no interest and non -revolving balances 3. consumers pay off debt and credit is automatically renewed 4. consumers take out a loan with a repayment date and have a specific purpose a. travel and entertainment credit b. revolving check credit c. closed-end credit d. revolving credit
Answers: 1
question
Business, 22.06.2019 06:50
Suppose the marginal damage and marginal benefit curves in a polluted neighborhood are md = p/3 and mb = 4 – p. also, suppose that transactions costs are low, so that the consumers and the firm can bargain. we saw that in this case, the socially-optimal level of pollution is achieved. start by computing the socially-optimal p. then, for each of the following cases, compute the amount of money transferred through the bargaining process, and indicate who pays whom (i.e., whether consumers pay the firm, or vice versa). also, compute the gains to each party relative to the status quo (i.e., the starting point of the bargaining process).a)consumers have the right to clean air; firm is dominant in the bargaining process.b)consumers have the right to clean air; consumers are dominant in the bargaining process.c)firm has the right to pollute; firm is dominant in the bargaining process.d)firm has the right to pollute; consumers are dominant in the bargaining proces
Answers: 1
You know the right answer?
Suppose that a system to process requests has several queues, one for each customer service represen...
Questions
question
Mathematics, 21.06.2021 16:10