/** * An interface for the Max-Heap ADT. Note that the ordering of * elements is determined with the T.compareTo() method. * @param the type of data the heap stores. * @author Jadrian Miles */ public interface Heap> { /** Adds the given item to the heap. */ public void add(T item); /** Removes and returns the maximum value in the heap. * @return null if the heap is empty. */ public T removeRoot(); /** Returns the maximum value, but doesn't change the heap. * @return null if the heap is empty. */ public T peek(); /** Returns true if the heap is empty. */ public boolean isEmpty(); /** Removes all items from the heap. */ public void clear(); }