a) Priority Queue In a hospital, as patients enter, the front desk records their name and assign them a priority number. These values will be inserted in a priority queue (a higher number indicates a higher priority). Once you get information from several patients and enter it into a priority queue, display this queue from the highest priority patient to the lowest priority patient. (As shown in the sample output). Sometimes a nurse may discover that a patient was given the wrong priority number and will want to modify this value. Write a function that will allow a nurse to search for a specific patient and change his/her priority number. Once you make these changes, display the queue again from the highest priority patient to the lowest priority patent. (See the sample output). (Hint: use of library functions from string.h header file will help when handling strings). You may want to come up with at least 3 separate functions: insert, display, and search Microsoft Visual Studio Debug Console Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Oliver Enter patient's priority #: 5 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Emma Enter patient's priority #: 2 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Amelia Enter patient's priority #: 8 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: James Enter patient's priority #: 9 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 3 Priority Queue is: James Pri:9| |Amelia Pri:8 |Oliver Pri:5| |Emma Pri:2| x
a) Priority Queue In a hospital, as patients enter, the front desk records their name and assign them a priority number. These values will be inserted in a priority queue (a higher number indicates a higher priority). Once you get information from several patients and enter it into a priority queue, display this queue from the highest priority patient to the lowest priority patient. (As shown in the sample output). Sometimes a nurse may discover that a patient was given the wrong priority number and will want to modify this value. Write a function that will allow a nurse to search for a specific patient and change his/her priority number. Once you make these changes, display the queue again from the highest priority patient to the lowest priority patent. (See the sample output). (Hint: use of library functions from string.h header file will help when handling strings). You may want to come up with at least 3 separate functions: insert, display, and search Microsoft Visual Studio Debug Console Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Oliver Enter patient's priority #: 5 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Emma Enter patient's priority #: 2 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: Amelia Enter patient's priority #: 8 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 1 Enter patient's first name: James Enter patient's priority #: 9 Enter 1 to add a new patient, 2 to change the priority, 3 to display the queue, Any other key to quit: 3 Priority Queue is: James Pri:9| |Amelia Pri:8 |Oliver Pri:5| |Emma Pri:2| x
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
![a) Priority Queue
In a hospital, as patients enter, the front desk records their name and assign them a
priority number. These values will be inserted in a priority queue (a higher number
indicates a higher priority). Once you get information from several patients and enter it
into a priority queue, display this queue from the highest priority patient to the lowest
priority patient. (As shown in the sample output).
Sometimes a nurse may discover that a patient was given the wrong priority number
and will want to modify this value. Write a function that will allow a nurse to search for a
specific patient and change his/her priority number. Once you make these changes,
display the queue again from the highest priority patient to the lowest priority patent.
(See the sample output).
(Hint: use of library functions from string.h header file will help when handling strings).
You may want to come up with at least 3 separate functions: insert, display, and search.
Microsoft Visual Studio Debug Console
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Oliver
Enter patient's priority #: 5
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Emma
Enter patient's priority #: 2
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Amelia
Enter patient's priority #: 8
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: James
Enter patient's priority #: 9
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 3
Priority Queue is: James Pri:9| |Amelia Pri:8| |Oliver Pri:5| |Emma Pri:2|
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 2
Enter the first name of the patient: Oliver
Enter the new priority: 1
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 3
Priority Queue is: James Pri:9| |Amelia Pri:8| |Emma Pri:2| |Oliver Pri:1|
Enter 1 to add a new patient, 2 to change the priority,
A](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5257d297-2deb-44f8-ae89-09a884023fd1%2F112323d7-ed45-4162-a6a6-d1e81d5dd52a%2Fc7q4aif_processed.jpeg&w=3840&q=75)
Transcribed Image Text:a) Priority Queue
In a hospital, as patients enter, the front desk records their name and assign them a
priority number. These values will be inserted in a priority queue (a higher number
indicates a higher priority). Once you get information from several patients and enter it
into a priority queue, display this queue from the highest priority patient to the lowest
priority patient. (As shown in the sample output).
Sometimes a nurse may discover that a patient was given the wrong priority number
and will want to modify this value. Write a function that will allow a nurse to search for a
specific patient and change his/her priority number. Once you make these changes,
display the queue again from the highest priority patient to the lowest priority patent.
(See the sample output).
(Hint: use of library functions from string.h header file will help when handling strings).
You may want to come up with at least 3 separate functions: insert, display, and search.
Microsoft Visual Studio Debug Console
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Oliver
Enter patient's priority #: 5
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Emma
Enter patient's priority #: 2
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: Amelia
Enter patient's priority #: 8
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 1
Enter patient's first name: James
Enter patient's priority #: 9
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 3
Priority Queue is: James Pri:9| |Amelia Pri:8| |Oliver Pri:5| |Emma Pri:2|
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 2
Enter the first name of the patient: Oliver
Enter the new priority: 1
Enter 1 to add a new patient, 2 to change the priority,
3 to display the queue, Any other key to quit: 3
Priority Queue is: James Pri:9| |Amelia Pri:8| |Emma Pri:2| |Oliver Pri:1|
Enter 1 to add a new patient, 2 to change the priority,
A
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY