Question: Part 3: Build the Priority Queue (PriorityQueue.java and ArrayHeap.java) You will implement a Priority Queue using Array Heaps as discussed in the class. class

Part 3: Build the Priority Queue (PriorityQueue.java and ArrayHeap.java) You will implement a Priority Queue using Array Heaps as discussed in the class. class PriorityQueue extends ArrayHeap Your priority queue should implement the following methods: void addElement (T object): Adds the given element to this PriorityQueue T removeNext(): Removes the next highest priority element from this priority queue and returns a reference to it. Hint: Your priority queue is storing HuffmanTreeNode objects. The PriorityQueue is extending from an ArrayHeap class, that means add (T object), T removeMin (), heapifyAdd () and heapifyRemove () will all be part of your ArrayHeap class. Look at the class notes.
Step by Step Solution
There are 3 Steps involved in it
Answer import javautilCollectionimport javautilComparatorimport javautilconcurrentExecutorpublic class PriorityQueue extends Queue public static final ... View full answer
Get step-by-step solutions from verified subject matter experts
