Question: Implement a priority queue in Java. The input with be a lit of names and their priority. With the following functions being included to support

Implement a priority queue in Java. The input with be a lit of names and their priority. With the following functions being included to support this. Insert(A,x) inserts the element x into the set A. Maximum(A) returns the element of A with the largest priority. Extract_Max(A) removes and returns the element of A with the largest priority. As an output, the program should produce a list of the names based on their priorities in decreasing order. The priorities are integers. The program should take this in from an input.txt file and create a sorted output.txt file when finishes. Using Priority Queue.

Ex input

Mike : 4

John : 3

Alex : 7

Ex output:

John Mike Alex

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!