Question: Use Java Priority Queue. Make a priority queue to represent customers being served at the Department of Motor Vehicles. Start with 100 customers in a
Use Java Priority Queue. Make a priority queue to represent customers being served at the Department of Motor Vehicles.
- Start with 100 customers in a List.
- In a loop, generate a priority for each customer (1-5)
- In a second loop, add the users to a priority queue
- Print the List and the Priority Queue
Step by Step Solution
3.44 Rating (160 Votes )
There are 3 Steps involved in it
import javautilLinkedList import javautilList import javautilRandom import javautil class Customer implements Comparable We cant create PriorityQueue ... View full answer
Get step-by-step solutions from verified subject matter experts
