Q. What does the enQueue operation do?
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.
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).
1. enQueue O(1).
2. deQueue O(1).
3. isFull O(1).
4. isEmpty O(1).
5. display O(n).
1. Limited number of space.