Waiting time in the queue by the driver can be used as a criterion whether toll plazas customer centric or not. Assume there are 3 counter serving customers. Customers who come will get in the shortest line (based on the number of customers / vehicles in the queue). Assume there are three categories of payment methods:

a. Using money - 40 seconds
b. Cards ' Touch & Go ' - 20 seconds
c. ‘Smart Tag ' - 10 seconds

Assume the same counter used for the three way payment.
Based on customer data is read from a file, create a program to calculate the waiting time for each customer. Calculate the average waiting time for customer average waiting time.

Assume that the management knew about the problem you give feedback results and ready to change the existing system, suggest the following alternatives to management:

1. Add counters / path
2. Use separate paths for the three above payment methods.

Your proposed alternative must be proved by computerized.

*is it better to use linked list or queue?

To calculate the waiting time for each customer and the average waiting time, you can use a queue data structure. A queue follows the First-In-First-Out (FIFO) principle, which means that the customer who arrives first will be served first.

Here's how you can approach the problem and implement it using a queue data structure:

1. Read the customer data from the file.
2. Create a queue to represent the line of customers.
3. Iterate through each customer in the given order:
a. Determine the payment method of the customer.
b. Based on the payment method, enqueue the customer into the corresponding queue.
4. While the queue is not empty:
a. Dequeue a customer from the queue.
b. Calculate the waiting time based on the payment method of the customer.
c. Store the waiting time for each customer in a data structure (e.g., list, array).
5. Calculate the average waiting time by summing up all the waiting times and dividing it by the total number of customers.

To suggest alternatives to management, you can compare the average waiting time for different scenarios:

1. Add counters/paths: Simulate the system with additional counters/paths and calculate the new average waiting time. If the average waiting time decreases significantly, it can be considered an improvement.

2. Use separate paths for the three payment methods: Simulate the system with separate paths for each payment method and calculate the new average waiting time. If the average waiting time decreases significantly compared to the previous scenarios, it can be considered a more efficient solution.

You can use any data structure that supports the queue functionality, such as a linked list or an array. Both data structures can be used to implement a queue efficiently. However, if you want to dynamically add or remove elements from the queue, a linked list would be a better choice as it allows for efficient insertion and deletion operations. On the other hand, if you have a fixed number of customers and want to access them randomly, an array may be more suitable.