Circular Queue implementation using Array

Q. What does the enQueue operation do?

Simulator
What is Circular Queue?

Circular Queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle. It is also called ‘Ring Buffer’.
In a normal Queue, we can insert elements until queue becomes full. But once queue becomes full, we can not insert the next element even if there is a space in front of queue.

Cicular Queue operations:

1. enQueue(Insert new element).

2. deQueue(Delete element).

3. isFull(Check if Queue is full).

4. isEmpty(Check if Queue is empty).

5. display(Display all queue elements).

Time complexity:

1. enQueue O(1).

2. deQueue O(1).

3. isFull O(1).

4. isEmpty O(1).

5. display O(n).

Drawbacks:

1. Limited number of space.

Run
What is Circular Queue?

Cicular Queue implementation using array

Data/Variables:
Free
Used
Array size: Min(5) & Max(9)
F
R
Operations
enQueue
deQueue
isFull
isEmpty
display
Reset