Queue Visualization



Start your Queue, Add Elements using Enqueue

OVERVIEW

A Queue Data Structure is a fundamental concept in computer science used for storing and managing data in a specific order. It follows the principle of "First in, First out" (FIFO), where the first element added to the queue is the first one to be removed.

Operations

  • Enqueue (Insert): Adds an element to the rear of the queue.
  • Dequeue (Delete): Removes and returns the element from the front of the queue.
  • Peek (Front): Returns the element at the front of the queue without removing it.
  • isEmpty: Checks if the queue is empty.
  • Size: Checks the number of elements in the queue.


Terminologies

  • Front: Position of the entry in a queue ready to be served, that is, the first entry that will be removed from the queue, is called the front of the queue. It is also referred as the head of the queue.
  • Rear: Position of the last entry in the queue, that is, the one most recently added, is called the rear of the queue. It is also referred as the tail of the queue.
  • Size: Size refers to the current number of elements in the queue.
  • Capacity: Capacity refers to the maximum number of elements the queue can hold.