Data Structures Queue by using Java

Assoc. Prof. Leon Abdillah

Data Structures Queue by using Java

Leon Andretti Abdillah

Data structures queue works based on the first in first out (FIFO) logic. In a FIFO data structure, the first element added to the queue will be the first one to be removed.

—A queue is a FIFO sequence. Addition takes place only at the tail, and removal takes place only at the head.
Data structures queue works with these methods:
  1. —add(x): add an item at the tail
  2. —poll: remove the item at the head
  3. —peek: return the item at the head (without removing it)
  4. —size: return the number of items in the queue
  5. —isEmpty: return whether the queue has no items



Abdillah, L. A. (2013). Algorithms & Programming. Available:

Abdillah, L. A. (2014). Data Structures & Algorithms. Available:

Sedgewick, R., & Wayne, K. (2012). Stacks and Queues. Introduction to Programming in Java, from

Toal, R. Data Structures. Queues, from

Leave a Reply

Your email address will not be published. Required fields are marked *