Question
Complete in JAVA PLEASE!!! ADT Priority Queue Given the interface to the priority queue. Implement the priority queue data structure using a single linked chain:
Complete in JAVA PLEASE!!! ADT Priority Queue Given the interface to the priority queue. Implement the priority queue data structure using a single linked chain: NODE: [address|data] Items can be compared use COMPARABLE
public interface PriorityQueueInterface> { /** Adds a new entry to this priority queue. @param newEntry An object to be added. */ public void add(T newEntry); /** Removes and returns the entry having the highest priority. @return Either the object having the highest priority or, if the priority queue is empty before the operation, null. */ public T remove(); /** Retrieves the entry having the highest priority. @return Either the object having the highest priority or, if the priority queue is empty, null. */ public T peek(); /** Detects whether this priority queue is empty. @return True if the priority queue is empty, or false otherwise. */ public boolean isEmpty(); /** Gets the size of this priority queue. @return The number of entries currently in the priority queue. */ public int getSize(); /** Removes all entries from this priority queue. */ public void clear(); } // end PriorityQueueInterface
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started