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, 22.06.2019 08:30
Match the items with the actions necessary to reconcile the bank statement.(there's not just one answer)1. interest credited in bank account2. fee charged by bank for returned check3. checks issued but not deposited4. deposits yet to be crediteda. add to bank statementb. deduct from bank statementc. add to personal statementd. deduct from personal statement
Answers: 2
question
Business, 22.06.2019 17:00
Vincent is interested in increasing his earning potential upon completing his internship at a major accounting firm. which option can immediately boost his career in the intended direction? b. complete a certification from a professional organization c. complete a new four-year undergraduate program in a related field d. complete a two-year associate degree in a related field e. complete an online course in accounting
Answers: 3
question
Business, 22.06.2019 19:50
What is the present value of the following cash flow stream at a rate of 12.0%? years: 0 1 2 3 4| | | | |cfs: $0 $1,500 $3,000 $4,500 $6,000a. $9,699b. $10,210c. $10,747d. $11,284e. $11,849
Answers: 3
question
Business, 22.06.2019 21:20
Afamily wishes to save for future college expenses. which financial tool should the family invest in?
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, 01.04.2021 18:20
question
Mathematics, 01.04.2021 18:20
Questions on the website: 13722363