Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create Java Project named MultipleQueueProject in order to implement a new data structure called MultipleQueueClass for maintaining two queues A and B at the same


Create Java Project named MultipleQueueProject in order to implement a new data structure called MultipleQueueClass for maintaining two queues A and B at the same time (in case you have two counter desks). You need to take into account the following requirements:

? The first element is inserted in the first queue A.

? A scenario when an element is already inserted in the first queue A, the second element has to be inserted in the second queue B.

? A new element is inserted in queue A if number of elements is the same in both queues.

? You need to delete an element from a given queue which has higher size of elements. You delete an element from the queue A if the size is the same in the two queues.

? You need to maintain the front and the rear of each queue.

? Maintain the elements of the two queues in two dimensional array list[ ][ ] Implement MultipleQueueClass using arrays to simulate two lines of queues in Counter waiting line. MultipleQueueClass should contains the following data members:

imageimage

Projects N Files Services MultipleQueueProject -Source Packages - multiplequeueproject MultipleQueueClass.java TestMultipleQueue.java Libraries MultipleQueueClass - Navigator Members MultipleQueueClass MultipleQueueClass( addQueue(Integer num) deleteQueue counts : int count int list: Integer 00 maxQueueSize: int queueFrontA : int queueFrontB : int queueRearA : int queueRearB: int Start Page Source History TestMultipleQueue.java MultipleQueueClass > MultipleQueueClass.java MultipleQueueClass > Output - MultipleQueueProject (run) DD DD xun: 1 The Element named 6 is queued in queueA system The Element named 17 is queued in queueR system The Element named 5 is queued in queue system The Element named The The 20 1 queued in queueR system Element named 15 is queued in queue system front of the queue A is 6 The back of the queue A is 15 The number of elements in the Queue A in :3 The front of the queue Bis 17 The back of the queue B is : 20 The number of elements in the Queue B 6 has withdrawn from the After dequeue: queuet The front of the queue A i S The back of the queue A is 15 The number of elements in the Queue A in The front of the queue Bis 17 The back of the queue Bin 20 The number of elements in the Queue B is :2 The Element named 30 is queued in queueh system After Adding in the queue: The front of the queue A is 5 The back of the queue A is : 20 The number of elements in the Queue A is :3 The front of the queue B is 17 The back of the queue Bo The number of elements in the Queue B is :2 5 has withdrawn from the queue After dequeue: The front of the queue A is 15 The back of the queue A is 30 The number of elements in the Queue A is The front of the queue B is : 17 The back of the queue B is = 20 The number of elements in the Queue B is 12 15 has withdrawn from the queuA After dequeue: The front of the queue A = = 30 The back of the queue A is : 30 The number of elements in the Queue A 13 =1 The front of the queue B is : 17 The back of the queue : 20 The number of elements in the Queue B is :2 BUILD SUCCESSFUL (total time seconds)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Scenario You have two counter desks represented by two queues A and B in a waiting line Requirements ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managerial Accounting

Authors: Ray H. Garrison, Eric W. Noreen, Peter C. Brewer

12th Edition

978-0073526706, 9780073526706

More Books

Students also viewed these Programming questions

Question

What is meant by the term variance?

Answered: 1 week ago

Question

What is meant by the term equivalent units of production?

Answered: 1 week ago