Page 1 of 1

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
by answerhappygod
Q2 Use A Priority Queue Data Structure To Implement A Java Program Which Keeps Track Of A Person S Daily Cash The Prog 1
Q2 Use A Priority Queue Data Structure To Implement A Java Program Which Keeps Track Of A Person S Daily Cash The Prog 1 (29.04 KiB) Viewed 22 times
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