Interface PriorityQueue

  • All Known Implementing Classes:

    public interface PriorityQueue
    Created by IntelliJ IDEA. User: pereira Date: Jun 18, 2005 Time: 7:46:46 PM Interface representing the basic methods for a priority queue.
    • Method Detail

      • insert

        void insert​(QueueElement e)
        Insert element e into the queue.
        e - the element to insert
      • size

        int size()
        The current size of the queue.
        current size
      • min

        QueueElement min()
        Return the top element of the queue.
        top element of the queue
      • extractMin

        QueueElement extractMin()
        Remove the top element of the queue.
        the element removed
      • changePriority

        void changePriority​(QueueElement e,
                            double priority)
        Change the priority of queue element e to priority. The element's position in the queue is adjusted as needed.
        e - the element that has been changed
        priority - the new priority
      • contains

        boolean contains​(QueueElement e)
        Does the queue contain an element?
        e - the element
        whether the queue contains the element
      • toArray

        QueueElement[] toArray()
        Returns any array containing all of the elements in the queue. They are not guaranteed to be in any particular order.