// K_Queue Interface
// Developed and modified by various instructors and TAs for the
// K College Data Structures course, starting with Autumn Spaulding Victor
// and Alyce Brady, circa 2000.
// Modified most recently in October 2025.

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>
 **/

public interface K_Queue<T>
{
    /** Returns <code>true</code> if this queue is empty;
     *  <code>false</code> otherwise.
     **/
    boolean isEmpty();

    /** 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;
 
}
