A Place for Latest Exam wise Questions, Videos, Previous Year Papers, Study Stuff for MCA Examinations - NIMCET
Previous Year Question (PYQs)
1
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
Solution
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:
$(REAR + 1) \mod n == FRONT$
Online Test Series, Information About Examination, Syllabus, Notification and More.