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, 21.06.2019 17:10
Write an application that allows a user to enter the names and birthdates of up to 10 friends. continue to prompt the user for names and birthdates until the user enters the sentinel value “zzz” for a name or has entered 10 names, whichever comes first. when the user is finished entering names, produce a count of how many names were entered, and then display the names. in a loop, continuously ask the user to type one of the names and display the corresponding birthdate or an error message if the name has not been previously entered. the loop continues until the user enters “zzz” for a name. save the application as birthdayreminder.java.
Answers: 1
question
Computers and Technology, 22.06.2019 02:10
3. (5 points) describe what would be printed by the code below or what error would occur. const char* cstr = "0123456"; const char* ptr = & cstr[4]; cout < < ptr[-1] < < ptr < < endl; 1 4. (5 points) theseus has been trapped in a maze with a minotaur, which is trying to capture him. each round, theseus and the minotaur move through the maze; theseus towards the exit, and the minotaur towards theseus. theseus can move in any of the four cardinal directions, or he can wait for a round to see how the minotaur moves. write code that creates a data type to represent the possible moves that theseus could make.
Answers: 3
question
Computers and Technology, 22.06.2019 04:00
When you collaborate or meet with a person or group online, it is called
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
From excel to powerpoint, you can copy and paste a. cell ranges and charts, one at a time. b. cell ranges and charts, simultaneously. c. charts only. d. cell ranges only.
Answers: 3
You know the right answer?
The clients are arriving to get passports. the arriving clients register at the window. each arrivin...
Questions
question
Mathematics, 15.10.2019 05:00
Questions on the website: 13722361