Lab 08

Food Order Scheduler

 

Objective:

 

During a busy lunch, a chef must cook orders while minimizing the average waiting time per customer. Unfortunately the chef only can cook the orders one at a time. Using a min-heap, schedule food orders based on their shortest cooking times in order to get the best average waiting times.

 

Lab Solution

 

Customer: <<customer’s name>>, Order: <<order’s name>>, Cooking Time Left: <<cooking time left>>

Where values in “<<>>” correspond to variable values.

 

 

Example Dialog:

-------------------------------------------

Starting Order Scheduler Simulation

-------------------------------------------

-------------------------------------------Minute 0-------------------------------------------

ORDER ADDED: Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 20

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 20

-------------------------------------------Minute 1-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 19

-------------------------------------------Minute 2-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 18

-------------------------------------------Minute 3-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 17

-------------------------------------------Minute 4-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 16

-------------------------------------------Minute 5-------------------------------------------

ORDER ADDED: Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 15

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 15

-------------------------------------------Minute 6-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 14

-------------------------------------------Minute 7-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 13

-------------------------------------------Minute 8-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 12

-------------------------------------------Minute 9-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 11

-------------------------------------------Minute 10-------------------------------------------

ORDER ADDED: Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 19

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 10

-------------------------------------------Minute 11-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 9

-------------------------------------------Minute 12-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 8

-------------------------------------------Minute 13-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 7

-------------------------------------------Minute 14-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 6

-------------------------------------------Minute 15-------------------------------------------

ORDER ADDED: Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 13

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 5

-------------------------------------------Minute 16-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 4

-------------------------------------------Minute 17-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 3

-------------------------------------------Minute 18-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 2

-------------------------------------------Minute 19-------------------------------------------

Currently Cooking Order:

Customer: Alicja Ulderico, Order: Raisin and strawberry yoghurt, Cooking Time Left: 1

-------------------------------------------Minute 20-------------------------------------------

ORDER ADDED: Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 16

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 13

-------------------------------------------Minute 21-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 12

-------------------------------------------Minute 22-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 11

-------------------------------------------Minute 23-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 10

-------------------------------------------Minute 24-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 9

-------------------------------------------Minute 25-------------------------------------------

ORDER ADDED: Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 11

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 8

-------------------------------------------Minute 26-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 7

-------------------------------------------Minute 27-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 6

-------------------------------------------Minute 28-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 5

-------------------------------------------Minute 29-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 4

-------------------------------------------Minute 30-------------------------------------------

ORDER ADDED: Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 21

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 3

-------------------------------------------Minute 31-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 2

-------------------------------------------Minute 32-------------------------------------------

Currently Cooking Order:

Customer: Frauke George, Order: Cuttlefish with rice, Cooking Time Left: 1

-------------------------------------------Minute 33-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 11

-------------------------------------------Minute 34-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 10

-------------------------------------------Minute 35-------------------------------------------

ORDER ADDED: Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 13

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 9

-------------------------------------------Minute 36-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 8

-------------------------------------------Minute 37-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 7

-------------------------------------------Minute 38-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 6

-------------------------------------------Minute 39-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 5

-------------------------------------------Minute 40-------------------------------------------

ORDER ADDED: Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 8

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 4

-------------------------------------------Minute 41-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 3

-------------------------------------------Minute 42-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 2

-------------------------------------------Minute 43-------------------------------------------

Currently Cooking Order:

Customer: Onesiphoros Davorka, Order: Mulberry and broccoli salad, Cooking Time Left: 1

-------------------------------------------Minute 44-------------------------------------------

Currently Cooking Order:

Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 8

-------------------------------------------Minute 45-------------------------------------------

ORDER ADDED: Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 18

Currently Cooking Order:

Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 7

-------------------------------------------Minute 46-------------------------------------------

Currently Cooking Order:

Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 6

-------------------------------------------Minute 47-------------------------------------------

Currently Cooking Order:

Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 5

-------------------------------------------Minute 48-------------------------------------------

Currently Cooking Order:

Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 4

-------------------------------------------Minute 49-------------------------------------------

Currently Cooking Order:

Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 3

-------------------------------------------Minute 50-------------------------------------------

Currently Cooking Order:

Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 2

-------------------------------------------Minute 51-------------------------------------------

Currently Cooking Order:

Customer: Imtiyaz Umar, Order: Spaghetti squash, Cooking Time Left: 1

-------------------------------------------Minute 52-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 13

-------------------------------------------Minute 53-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 12

-------------------------------------------Minute 54-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 11

-------------------------------------------Minute 55-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 10

-------------------------------------------Minute 56-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 9

-------------------------------------------Minute 57-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 8

-------------------------------------------Minute 58-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 7

-------------------------------------------Minute 59-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 6

-------------------------------------------Minute 60-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 5

-------------------------------------------Minute 61-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 4

-------------------------------------------Minute 62-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 3

-------------------------------------------Minute 63-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 2

-------------------------------------------Minute 64-------------------------------------------

Currently Cooking Order:

Customer: Nirmala Erna, Order: Chestnut and chorizo soup, Cooking Time Left: 1

-------------------------------------------Minute 65-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 15

-------------------------------------------Minute 66-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 14

-------------------------------------------Minute 67-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 13

-------------------------------------------Minute 68-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 12

-------------------------------------------Minute 69-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 11

-------------------------------------------Minute 70-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 10

-------------------------------------------Minute 71-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 9

-------------------------------------------Minute 72-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 8

-------------------------------------------Minute 73-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 7

-------------------------------------------Minute 74-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 6

-------------------------------------------Minute 75-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 5

-------------------------------------------Minute 76-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 4

-------------------------------------------Minute 77-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 3

-------------------------------------------Minute 78-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 2

-------------------------------------------Minute 79-------------------------------------------

Currently Cooking Order:

Customer: Philomel Olivette, Order: Roquefort salad, Cooking Time Left: 1

-------------------------------------------Minute 80-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 16

-------------------------------------------Minute 81-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 15

-------------------------------------------Minute 82-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 14

-------------------------------------------Minute 83-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 13

-------------------------------------------Minute 84-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 12

-------------------------------------------Minute 85-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 11

-------------------------------------------Minute 86-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 10

-------------------------------------------Minute 87-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 9

-------------------------------------------Minute 88-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 8

-------------------------------------------Minute 89-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 7

-------------------------------------------Minute 90-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 6

-------------------------------------------Minute 91-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 5

-------------------------------------------Minute 92-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 4

-------------------------------------------Minute 93-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 3

-------------------------------------------Minute 94-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 2

-------------------------------------------Minute 95-------------------------------------------

Currently Cooking Order:

Customer: Goodwin Kendra, Order: Sausage with berry salad, Cooking Time Left: 1

-------------------------------------------Minute 96-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 18

-------------------------------------------Minute 97-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 17

-------------------------------------------Minute 98-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 16

-------------------------------------------Minute 99-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 15

-------------------------------------------Minute 100-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 14

-------------------------------------------Minute 101-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 13

-------------------------------------------Minute 102-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 12

-------------------------------------------Minute 103-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 11

-------------------------------------------Minute 104-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 10

-------------------------------------------Minute 105-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 9

-------------------------------------------Minute 106-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 8

-------------------------------------------Minute 107-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 7

-------------------------------------------Minute 108-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 6

-------------------------------------------Minute 109-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 5

-------------------------------------------Minute 110-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 4

-------------------------------------------Minute 111-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 3

-------------------------------------------Minute 112-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 2

-------------------------------------------Minute 113-------------------------------------------

Currently Cooking Order:

Customer: Marita Adel, Order: Cheddar and ham sandwich, Cooking Time Left: 1

-------------------------------------------Minute 114-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 19

-------------------------------------------Minute 115-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 18

-------------------------------------------Minute 116-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 17

-------------------------------------------Minute 117-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 16

-------------------------------------------Minute 118-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 15

-------------------------------------------Minute 119-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 14

-------------------------------------------Minute 120-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 13

-------------------------------------------Minute 121-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 12

-------------------------------------------Minute 122-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 11

-------------------------------------------Minute 123-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 10

-------------------------------------------Minute 124-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 9

-------------------------------------------Minute 125-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 8

-------------------------------------------Minute 126-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 7

-------------------------------------------Minute 127-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 6

-------------------------------------------Minute 128-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 5

-------------------------------------------Minute 129-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 4

-------------------------------------------Minute 130-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 3

-------------------------------------------Minute 131-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 2

-------------------------------------------Minute 132-------------------------------------------

Currently Cooking Order:

Customer: Ines Marleen, Order: Mussels, Cooking Time Left: 1

-------------------------------------------Minute 133-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 21

-------------------------------------------Minute 134-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 20

-------------------------------------------Minute 135-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 19

-------------------------------------------Minute 136-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 18

-------------------------------------------Minute 137-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 17

-------------------------------------------Minute 138-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 16

-------------------------------------------Minute 139-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 15

-------------------------------------------Minute 140-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 14

-------------------------------------------Minute 141-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 13

-------------------------------------------Minute 142-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 12

-------------------------------------------Minute 143-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 11

-------------------------------------------Minute 144-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 10

-------------------------------------------Minute 145-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 9

-------------------------------------------Minute 146-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 8

-------------------------------------------Minute 147-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 7

-------------------------------------------Minute 148-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 6

-------------------------------------------Minute 149-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 5

-------------------------------------------Minute 150-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 4

-------------------------------------------Minute 151-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 3

-------------------------------------------Minute 152-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 2

-------------------------------------------Minute 153-------------------------------------------

Currently Cooking Order:

Customer: Albin Bao, Order: Feta and apricot salad, Cooking Time Left: 1

-------------------------------------------Minute 154-------------------------------------------

ALL ORDERS COMPLETE

The average Waiting Time is: 56.6 minutes

 

Solution Tests:

  1. Is your name written as a comment in all source files?
  2. Does the solution compile (no syntax errors)?
  3. Does the output match the example dialog?

 

Lab Report

  1. Create a section named “Problem” and describe this lab’s problem in your own words. (10pts).
  2. Create a section named “Solution Description” and describe how the code solves the problem in your own words. (10pts).
  3. Create a section named “Problems Encountered” and describe the various syntax, run-time, and logic errors that were encountered while implementing the solution. (10pts)
  4. What is the Big O complexity of inserting one element into a heap? (10pts)
  5. What is the Big O complexity of heap sort? (10pts)
  6. Draw the structure of a Max Heap after the following operations

 

ADD 5, 2, 3, 1, 7, 8, 9

REMOVE 3 Times

ADD 4, 12, 16

REMOVE 2 Times

 

  1. Draw the structure of a Min Heap after the following operations

 

ADD 10, 5, 3, 12, 7, 16, 9

REMOVE 3 Times

ADD 6, 1, 8

REMOVE 2 Times

 

  1. If we assume the root index in an Array Heap is 0, then how can we calculate the index of the left child?
  2. If we assume the root index in an Array Heap is 0, then how can we calculate the index of the right child?
  3. If we assume the root index in an Array Heap is 0, then how can we calculate the index of the node’s parent?

 

Finally

Upload the Lab Solution’s source code (.JAVA file(s)) and the Lab Report’s text file to the CSCE Dropbox.