Package dsa.iface

Interface IQueue<T>

All Known Implementing Classes:
LinkedQueue

public interface IQueue<T>
ADT to represent a Queue. A Queue is a First-In, First-Out (FIFO) data structure.
  • Method Summary

    Modifier and Type
    Method
    Description
    Remove and return the first element in the queue.
    void
    enqueue(T element)
    Add element to the back of the queue.
    Get (but don't remove) the element at the front of the queue.
    boolean
    Check if the queue is empty.
    int
    Get the number of elements in the queue.
  • Method Details

    • enqueue

      void enqueue(T element)
      Add element to the back of the queue.
      Parameters:
      element -
    • dequeue

      T dequeue()
      Remove and return the first element in the queue.
      Returns:
    • size

      int size()
      Get the number of elements in the queue.
      Returns:
    • isEmpty

      boolean isEmpty()
      Check if the queue is empty.
      Returns:
      true if the queue contains no elements, false otherwise.
    • front

      T front()
      Get (but don't remove) the element at the front of the queue.
      Returns: