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 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
Answers: 2
question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
You know the right answer?
The clients are arriving to get passports. the arriving clients register at the window. each arrivin...
Questions
question
Mathematics, 20.09.2019 18:30