Queue Visualizer

Null

Size of the Queue:-

Peek value(Front) :-

Queue is Empty:-

A queue is a linear data structure that follows the FIFO (First In, First Out) principle.

Elements are added at the rear and removed from the front.

Types of Queues:-

  1. Simple Queue: Follows FIFO. Insert at rear, delete from front.
  2. Circular Queue: Connects rear to front to reuse space efficiently.
  3. Priority Queue: Elements are dequeued based on priority, not order.
  4. Deque (Double-Ended Queue): Insertion and deletion are allowed at both ends.

Core Operations:-

  1. enqueue(x): Add x to rear
  2. dequeue(): Remove front element
  3. peek(): View front element
  4. is Empty(): Check if queue is empty

Time Complexity:- O(1)

Space Complexity:- O(n)