subject

The clients are arriving to get passports. the arriving clients register at the window. each arriving client has a priority number and name. the priority numbers vary from 1 to 10. ten being the highest priority and 1 being the lowest. at 10: 00 am, the passport office will start serving clients that had registered by then at the window. the clients will be served not in the order that they arrived but in the order of their priority. first, all with priority 10; then those with priority 9 and so on.

to simulate the above, create an array based priority queue using max heap. input registering clients one by one and enque them one by one into the priority queue. each client input data will consist of client priority and name. priority of -1 will indicate end of data. after all the clients are enqued, deque them from the priority queue one by one and display them one by one till priority queue becomes empty. see the test input data and the expected output below.

test data

input data

3 jim

2 judy

7 jill

1 jimmy

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:00
If you're using an existing powerpoint presentation that will receive new slides based on a word outline, select the a. slide that will appear after the new slides. b. first slide in the presentation. c. slide that will appear before the new slides. d. last slide in the presentation.
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
Answers: 2
question
Computers and Technology, 24.06.2019 07:00
Why do we mark tlc plates with pencil and not with pen
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
You know the right answer?
The clients are arriving to get passports. the arriving clients register at the window. each arrivin...
Questions
question
Mathematics, 14.10.2019 18:20
Questions on the website: 13722361