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, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 24.06.2019 19:20
Which command suppresses the visibility of a particular row or column in a worksheet?
Answers: 1
question
Computers and Technology, 25.06.2019 05:00
How many meatballs required for a larty of 25 adults and 6 children
Answers: 1
question
Computers and Technology, 25.06.2019 07:00
Asap 50 points ( paragraph pls) discuss the role of the concept behind the "internet of things (iot)" in today's digitally connected society.
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, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
History, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Chemistry, 18.09.2020 15:01
question
History, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
History, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
Mathematics, 18.09.2020 15:01
question
History, 18.09.2020 15:01
Questions on the website: 13722363