What is overflow and underflow condition of Circular Queue?



Ayush Said

+0 -0

Overflow: In a circular queue, an overflow condition occurs when the queue is full and a new element is added to the queue. This can lead to overwriting the oldest element in the queue and loss of data.
((rear + 1) % MAX_SIZE == front)
Underflow: In a circular queue, an underflow condition occurs when the queue is empty and an element is removed from the queue. This can lead to an error in the program, as the queue is unable to provide the requested data.
(front == rear)



Submit Your Response