Question Id : 18458 |
Context : UGC NET Computer Science June 2023 (Paper II)
Suppose a circular queue of capacity $(n - 1)$ elements is implemented with an array of $n$ elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variable respectively. Initially, REAR = FRONT = 0. The conditions to detect queue empty and queue full are
🎥 Video solution / Text Solution of this question is given below:
In a circular queue with capacity $(n - 1)$:
Queue is empty when:
REAR == FRONT
Queue is full when the next position of REAR becomes FRONT: