Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE LANGUAGE: C++ Implement two priority queues to simulate an afternoon in an emergency room. Your software should NOT be dependent on the given data.

CODE LANGUAGE: C++

Implement two priority queues to simulate an afternoon in an emergency room.

Your software should NOT be dependent on the given data.

Priority Queue 1) Develop software or use the authors priority queue ADT to implement a priority queue based on a heap.

Priority Queue 2) Use the STL priority_queue. Test both priority queues with the following data assuming that the priority queue is built at noon and Doctor DoGood is the only doctor on duty. Each patient requires 25 minutes of care. The patient who waited for the longest has the highest priority unless there is a life-threatening scenario. Determine the order in which the patients will be treated. You will need to create a timer. Output the time each appointment starts and ends.

Assumptions:

1. When a patient's care is interrupted, they still only get 25minutes of care total

2. If a patients treatment starts at 1:00 and is not interrupted, then the next patients treatment will start at 1:25

3. Waiting time is the wait time before noon

Please include comments and the heap that needs to be used is not specified so it could be any type of heap.

image text in transcribed

Start End Name Bob Bleeding Frank Feelingbad Cathy Coughing Sam Sneezing Paula Pain Sid Sickly Alice Ailment Irene III Tom Temperature Waiting Time (hours) 6 3 5 Life threatening at 1:34 PM 4 Life threatening at 2:12 PM 7 1 8 Start End Name Bob Bleeding Frank Feelingbad Cathy Coughing Sam Sneezing Paula Pain Sid Sickly Alice Ailment Irene III Tom Temperature Waiting Time (hours) 6 3 5 Life threatening at 1:34 PM 4 Life threatening at 2:12 PM 7 1 8

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

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago

Question

Differentiate tan(7x+9x-2.5)

Answered: 1 week ago

Question

Explain the sources of recruitment.

Answered: 1 week ago

Question

Differentiate sin(5x+2)

Answered: 1 week ago