188 views
Consider a standard Circular Queue ‘q’ implementation (which has the same condition for Queue Full and Queue Empty) whose size is 11 and the elements of the queue are q[1], q[2], ……, q[10]. The front and rear pointer are initialized to point at q[2]. In which position will the ninth element be added?

1. https://gateoverflow.in/17423/isro2014-36

Ans: q[0]

In circular queue, $enqueue$ operation takes place as - first rear is incremented then element is inserted. So first element will be inserted at $q[3]$ and so on. Hence the 9th element will be inserted at $q[0]$.