Question: Task1: implement a concrete ALPQueue class (an ArrayList based priority queue) that extends the AbstractPQueue discussed in the class, along with PQueue.java, ArrayList.java, List.java, PQEntry.java

Task1: implement a concrete ALPQueue class (an ArrayList based priority queue) that extends the AbstractPQueue discussed in the class, along with PQueue.java, ArrayList.java, List.java, PQEntry.java , EntryComparitor.java, and OutOfRangeException.java given in the class (any other different queue class implementation, even if it is implemented by yourself, will not receive any credit). Task2: implement a concrete HeapPQueue class (a Heap based priority queue) that extends the AbstractPQueue discussed in the class. Similary, you also need PQueue.java, ArrayList.java, List.java, PQEntry.java , EntryComparitor.java, and OutOfRangeException.java given in the class (any other different queue class implementation, even if it is implemented by yourself, will not receive any credit). The ADT of HeapPQueue class is given below: public class HeapPQueue extends AbstractPQueue { private ArrayList list = new ArrayList();; //constructor public int size(); public boolean isEmpty(); public void heapUp(int i); public void heapDown(int i); public PQEntry insert(Integer key, String value); public PQEntry removeMin(); public PQEntry min(); } Task3: write a performance test program to measure the performance of the above two classes in running time. To do that, you may want to construct two big priority queue instances: one for ALPQueue and one for HeapPQueue. Perform at least 5,000 (random numbers) insert() operations and 5,000 removeMin() operation for each priority queue. Your test program should print out the following information: ALPQueue: insert 5000 elements: xxx ms remove 5000 elements: xxx ms HeapPQueue: insert 5000 elements: xxx ms remove 5000 elements: xxx ms

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!