Package dsa

Interface Queue<Item>

    • Method Detail

      • isEmpty

        boolean isEmpty()
        Returns true if this queue is empty, and false otherwise.
        Returns:
        true if this queue is empty, and false otherwise.
      • size

        int size()
        Returns the number of items in this queue.
        Returns:
        number of items in this queue.
      • enqueue

        void enqueue​(Item item)
        Adds item to the end of this queue.
        Parameters:
        item - the item.
      • peek

        Item peek()
        Returns the item at the front of this queue.
        Returns:
        item at the front of this queue.
      • dequeue

        Item dequeue()
        Removes and returns the item at the front of this queue.
        Returns:
        item at the front of this queue.