/** * Base interface for priority queue implementations for doubles. * Throw exceptions as appropriate. */ public interface PriorityQueue { /** * Returns true if priority queue has no elements * * @return true if the priority queue has no elements */ public boolean isEmpty(); /** * Returns the minimum element in the priority queue * * @return the minimum element or throw EmptyHeapException if empty */ public double findMin(); /** * Inserts a new element into the priority queue. * Duplicate values are allowed. * * @param x element to be inserted into the priority queue. */ public void insert(double x); /** * Removes and returns the minimum element from the priority queue. * * @return the minimum element or throw EmptyHeapException if empty */ public double deleteMin(); /** * Erases all elements from the priority queue. */ public void makeEmpty(); }