The Priority Queue Class You will use a priority queue of patients to determine the order that
Fantastic news! We've Found the answer you've been seeking!
Question:
The Priority Queue Class
You will use a priority queue of patients to determine the order that patients are seen by the doctor. Before writing the code to simulate the emergency room, you should implement the priority queue as below. Remember to test the priority queue as you develop it.
- • Your priority queue must be implemented using a heap of Patients.
- • The public methods for your priority queue will be insert (add a new item to the queue), deleteMax (remove the highest priority item from the priority queue), peek (peek at the highest priority item in the priority queue), and isEmpty.
- • The highest priority patients should be located at the top of the heap (front of the priority queue).
- • The isEmpty method will return true if the queue contains no items and false otherwise.
- • The insert method will insert a patient into the priority queue, so that the highest priority patient is at the front of the queue (i.e. you will pass insert a Patient object).
- • The deleteMax method will return the patient at the front of the priority queue (i.e. deleteMax will return a Patient object), and will remove that patient from the queue.
- • The peek method will return the patient at the front of the priority queue, but will leave that patient in the queue.
- Using these methods from queue library is not allowed!!!
Related Book For
Introduction to Management Science A Modeling and Cases Studies Approach with Spreadsheets
ISBN: 978-0078024061
5th edition
Authors: Frederick S. Hillier, Mark S. Hillier
Posted Date: