/** * Implements the interface for priority queue implementations for doubles. */ public class BinaryMinHeap implements PriorityQueue { private int size; private Node overallRoot; /** * TODO: comment this class */ private class Node() { public double data; public Node left; public Node right; } /** * TODO: comment this */ public double findMin() { if (size == 0) { throw new EmptyHeapException(); } return overallRoot.data; } /** * Returns true if priority queue has no elements * * @return true if the priority queue has no elements */ public boolean isEmpty() { return false; } /** * Returns the number of elements in this priority queue. * * @return the number of elements in this priority queue. */ public int size() { return 0; } /** * 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() { return 0; } /** * Resets the priority queue to appear as not containing * any elements. */ public void makeEmpty() {} }