Question
The most common use of Max-Heap priority queues is in simulation. A simulation of a hospital waiting room, for example, might prioritize patients waiting based
The most common use of Max-Heap priority queues is in simulation. A simulation of a hospital waiting room, for example, might prioritize patients waiting based on the severity of their need. For example, doctors in a hospital emergency room often choose to see next the "most critical" patient rather than the one who arrived first.
You are asked to develop a simple program for doctors and administrators to dynamically keep track of treatment scheduling for patients according to priority in the hospital emergency room. A patient with a more critical problem will pre-empt others even if they have been waiting longer.
Programming Requirements:
1. The dynamic scheduling software application MUST be written in Java and is required to use Max-Heap Priority Queue approach.
2. This Max-Heap priority queue, where elements are prioritized relative to each other and when a patient's treatment is finished, the software is asked to Extract-Max(S) one patient with the highest priority in the queue that is removed.
3. The priority queue implemented in a Max-Heap Tree will store a collection of structs that keep track of the patient's name and an integer for the priority. Larger integers are considered higher priority than smaller ones (Assuming each time there are 20 patients in the MAX-Heap tree only.)
4. The software MUST at least contains the following functions:
1. Max-Heapify()
2. Build-Max-Heap()
3. Heapsort()
4. Max-Heap-Insert()
5. Heap-Extract-Max
6. Heap-Increase-Key
7. Heap-Maximum
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