Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface PriorityQueue<T extends Comparable<? super T>> {
- /** Adds the given item to the queue. */
- public void add(T item);
- /** Removes the first item according to compareTo from the queue, and returns it.
- * @return null if the queue is empty.
- */
- public T poll();
- /** Returns the first item according to compareTo in the queue, without removing it.
- * @return null if the queue is empty.
- */
- public T peek();
- /** Returns true if the queue is empty. */
- public boolean isEmpty();
- /** Removes all items from the queue. */
- public void clear();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement