import java.util.NoSuchElementException;

/** The K_Queue interface specifies the methods for a <em>Queue</em>
 *  abstract data structure.  This interface is simpler and more
 *  straight-forward than the Java <code>Queue</code> interface in the Java
 *  Collection Classes.
 *
 *  The basic <code>enqueue</code> and <code>dequeue</code> operations in
 *  this interface act as follows:
 *  <ul>
 *    <li>The enqueue method adds an element to the "back" of the
 *        data structure.
 *    <li>The dequeue method acts as follows:
 *        <ul>
 *        <li>If the queue is empty, an exception is thrown.
 *        <li>If the queue contains one element, dequeue returns that element,
 *          leaving the queue empty.
 *        <li>If the queue contains multiple elements, dequeue returns the
 *          element at the "front" of the queue, the one that has been there
 *          longest.  (FIFO - First In, First Out)
 *        </ul>
 *  </ul>
 *
 *  @author Autumn Spaulding Victor and Alyce Brady (originally around 2000)
 *  @author Various K College Data Structures instructors and TAs
 *  @version October 2025
 **/

public interface K_Queue<T>
{
    /** Returns <code>true</code> if this queue is empty;
     *  <code>false</code> otherwise.
     **/
    boolean isEmpty();
 
    /** Returns the number of elements in the queue.  Arguably this
     *  method should not be part of a pure Queue abstract data type,
     *  but it is useful for debugging.
     */
    int size();

    /** Adds a specified object to the "back" of this queue.
     *    @param item - the object to add to the queue
     **/
    void enqueue(T item);

    /** Removes the element at the "front" of this queue.
     *    @returns the removed element
     *    @throws NoSuchElementException if the queue is empty
     **/
    T dequeue() throws NoSuchElementException;

    /** Returns the element at the "front" of this queue, without
     *  modifying the queue.
     *    @returns the element at the front of the queue
     *    @throws NoSuchElementException if the queue is empty
     **/
    T peekNext() throws NoSuchElementException;
}
