in DS
531 views
1 vote
1 vote
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?
in DS
531 views

1 comment

0
0

1 Answer

1 vote
1 vote
Best answer
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]$.

Related questions