1

Suppose a circular queue of capacity (n – 1) elements is implemented with an array of n elements. Assume that the insertion and deletion operation are carried out using REAR and FRONT as array index variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are

Correct Answer: full: (rear+1) mod n == front, empty: rear == front

Make the most of this question

This page focuses on one Data Structure (DS) question from Engineering. After checking the answer, return to the topic list to practice more or run a timed set.