Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Simulation of Multiple Queues A supermarket can serve multiple queues of customers. Whenever a queue gets too long, some customers will automatically switch to another
Simulation of Multiple Queues
A supermarket can serve multiple queues of customers. Whenever a queue gets too long, some customers will automatically switch to another queue. In this assignment you are asked to simulate such a queue known as a double ended queue where you can enqueue and then dequeue from either end. In our application we only need to enqueue to the back, there is no need to for enqueue to the front.
In this assignment, you will use fixed arrays to represent the queues. In this assignment you will create at least queues to simulate such a queueing system in a supermarket. You can assume that each customer has a unique name ie Create a pool of Strings eg to assign to each queue The program will randomly assign the names to the queues so some queues will eventually be longer than other queues Every time when assigning, the difference in length of one queue compared to others is more than you will dequeue from the back of the queue and reassign randomly to one of the other queues. Eventually you will have queues The longest and shortest queue will differ by at most pls write a java script with solution
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started