Question
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.
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started