Choose the best collection for each situation.
You need to keep a record of the ages of the last 50 customers visit a restaurant. As new customers come in you delete the age that has been in the list the longest.

You need to store the GPS coordinates of the hospitals in a state in order to find the nearest hospital for ambulance helicopters.

You write a loop to save anywhere from 10 to 100 values from a user. You will pass the collection to a function to find the average.

Respuesta :

Answer:

Deque: You need to keep a record of the ages of the last 50 customers visit a restaurant. As new customers come in you delete the age that has been in the list the longest.

Tuple: You need to store the GPS coordinates of the hospitals in a state in order to find the nearest hospital for ambulance helicopters.

List: You write a loop to save anywhere from 10 to 100 values from a user. You will pass the collection to a function to find the average.

Explanation: Just got the results back no thanks to the guy above

The best collection for the situations will be deque, tuple, and list.

A deque refers to the ordered collection of items that is similar to the queue. It has two ends and the items remain in position in the collection.

A tuple refers to the finite ordered sequence of elements. It is a data structure that is used in storing an ordered sequence of values.

Since the last 50 customers visit a restaurant, deque will be utilized. Tuple will be used when one needs to store the GPS coordinates of the hospitals in a state in order to find the nearest hospital for ambulance helicopters.

Read related link on:

https://brainly.com/question/17483083

ACCESS MORE