Suppose a circular queue of capacity \((n −1)\) elements is implemented with…

GATE · 2012 · CS · Computer Science & IT

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

  1. A.

    fullfull: (REAR+1) mod n == FRONT

    emptyempty: REAR == FRONT

  2. B.

    fullfull: (REAR+1) mod n == FRONT

    emptyempty: (FRONT+1) mod n == REAR

  3. C.

    fullfull: REAR == FRONT

    emptyempty: (REAR+1) mod n == FRONT

  4. D.

    fullfull: (FRONT+1) mod n == REAR

    emptyempty: REAR == FRONT

Attempted by 866 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…