Answer: PROCEDURE ADD(QUEUE, F, R, N, item)
[This will inserts ‘item’ in the ‘queue’ after ‘R (rare)’ where ‘n’ is size of array.]
1. [Overflow ?]
if (R >= N)
write Stack is full.
return.
2. [Increment R]
R <-- R + 1
3. [Insert Element]
QUEUE [R] <-- item.
4. [Setting the ‘F (Front)’ pointer]
if (F=0)
F=1
return.