Interface PriorityQueue<E extends java.lang.Comparable>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void clear()
      Empties the queue.
      E deleteMin()
      Deletes the minimum element in the queue.
      E findMin()
      Finds the minimum element in the queue.
      void insert​(E element)
      Inserts an element into the queue.
      boolean isEmpty()
      Determines whether the queue is empty or not.
      int size()
      Returns the size of the queue.
    • Method Detail

      • clear

        void clear()
        Empties the queue.
      • size

        int size()
        Returns the size of the queue.
        Returns:
      • insert

        void insert​(E element)
        Inserts an element into the queue.
        Parameters:
        element -
      • isEmpty

        boolean isEmpty()
        Determines whether the queue is empty or not.
        Returns:
      • findMin

        E findMin()
        Finds the minimum element in the queue. This method is non-destructive peeking. The queue is left untouched.
        Returns:
        the minimum element in the queue. If the queue is empty, return null.
      • deleteMin

        E deleteMin()
        Deletes the minimum element in the queue.
        Returns:
        the minimum element in the queue. If the queue is empty, return null.