Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Queue Data Structure A small supermarket has at the output two payment boxes. There are 10 shopping carts on the premises. Write program that simulate

Queue Data Structure

A small supermarket has at the output two payment boxes. There are 10 shopping carts on the premises. Write program that simulate the operation, following the following rules:

If when a customer arrives, there is no shopping cart available, wait until it is available.

No customer gets impatient and leaves the supermarket without going through any of the lines of the boxes.

When a customer completes their purchase, it is placed in the queue of the box that there are fewer people, and it is not changed queue.

As soon as a customer pays at the checkout, their shopping cart becomes available.

Represent the list of shopping carts and output boxes by means of queues.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Students also viewed these Programming questions