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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started