In this tutorial, you will learn the Queue data structure, its operations and basic implementation example with Java

What is Queue Data Structure?

Queue is a linear data structure of similar data type items, stores data in FIFO (First In First Out) order

Basic operations

  • Insert aka Enqueue, adds an item onto the end of the queue
  • Remove aka Dequeue, retrieves and removes the head of the queue
  • Examine, retrieves, but does not remove, the head of the queue

Other operations

  • isEmpty returns true if no more items can be dequeued
  • isFull returns true if no more items can be enqueued
  • size returns the number of items on the queue


You can implement a queue with either a Linked List, a Static Array (capacity restricted) or a Dynamic Array

Queue implementation example with Static Array


  • Breath First Search uses a queue to track which elements to visit next