Jasica

Computer Homework Help

Computer Homework Help

Question

 

Java Question

Show the contents of an initially empty priorityqueue after each of the followingstatements execute.

Assume that the first character of the object (the number)specifies its priority. For example, object 1a has priority 1 andobject 2b has priority 2.

Lower numbers have higher priorities. So 2b has a higherpriority than 3d; 2b has the same priority as 2e.

Put the front of the priority queue on theleft and the back on the right.

pq1.add(1d)

pq1.add(2e)

pq1.add(1a)

pq1.add(2a)

pq1.add(1c)

pq1.add(1e);

pq1.remove()

pq1.add(pq1.remove())

pq1.add(pq1.getFront())

pq1.remove()   

pq1.remove()

pq1.remove();

pq1.remove();

Pending
Other / Other
12 Sep 2017
Due Date: 12 Sep 2017

Report As Dispute

Share Your Feedback

Give Review : A+ A B C D F