Q2. Use a Priority Queue data structure to implement a java program which keeps track of a person's daily cash. The prog
Posted: Mon Jun 06, 2022 6:03 pm
Q2. Use a Priority Queue data structure to implement a java program which keeps track of a person's daily cash. The program should proceed in the following order: a) Create an empty Priority Queue called "spent" b) Then add 100 to the empty Priority Queue c) Then add 2 to the PriorityQueue d) Then add 17 to the PriorityQueue e) Then Print the all the items in the PriorityQueue f) Then print the smallest element in the PriorityQueue (5 marks) import java.util.PriorityQueue; public class Main { public static void main(String[] args) { // Write your code below