## Queue

 Question 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 variables, respectively. Initially, REAR = FRONT = 0. The conditions to detect queue full and queue empty are
 A full: (REAR+1)mod n == FRONT empty: REAR == FRONT B full: (REAR+1)mod n == FRONT empty: (FRONT+1) mod n == REAR C full: REAR == FRONT empty: (REAR+1) mod n == FRONT D full: (FRONT+1)mod n == REAR empty: REAR == FRONT
Data Structures        Queue       Gate 2012
Question 1 Explanation:

To circulate within the queue we have to write mod n for (Rear + 1).
We insert elements using Rear & delete through Front.
 Question 2

 A Leaves the queue Q unchanged B Reverses the order of the elements in the queue Q C Deletes the element at the front of the queue Q and inserts it at the rear keeping the other elements in the same order D Empties the queue Q
Data Structures        Queue       Gate 2007-IT
Question 2 Explanation:
As a recursive call, and removing from front while inserting from end, that means that element will be deleted at last and will be inserted 1st in the new queue. And like that it will continue till first call execute insert (Q, i) function. So the queue is in reverse order.
There are 2 questions to complete.