Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. (20 points) Solve each of the design problems below using the data structures we have learned so far: List, Stack, and Queue. For each,

image text in transcribed
6. (20 points) Solve each of the design problems below using the data structures we have learned so far: List, Stack, and Queue. For each, specify the data structure(s) to use and how you would use them to perform all the necessary operations. You should only use a List if the Stack and Queue operations are not sufficient to solve the design problem. (a) A busy pizza place wants to keep track of orders even when they come in faster than the pizza makers can get the pizzas into the oven. Specifically, you need a data structure to which pizza orders can be added as they come in. As an order is added, the data structure must provide a time estimate when that pizza will be ready; 2 (number of waiting orders) +12 minutes. The data structure must also support retriving the next order to make. To avoid complexity, the pizza place always makes pizzas in the order in which the requests were made; they don't support making an order to be ready at a certain time. (b) One isswe with having many kids is that they often fight. (Whose turn is it to ride in the first seat? Who gets to pick the program on TV? Who gets to sit where during dinner? etc.) To reduce this, my family has all the kids take turns being in charge of "important" decisions like this. Once one kid gets their turn, they don't get to be in charge again until all the other kids have had a turn. To manage this, we need an application with one operation to identify the person whose turn it is and simultaneously ensure that their name doesn't come up until all the others have had a turn. What ADT(s) would you use for this application and how would you use it to support the required operations

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 Databases questions