retagged by
2,027 views
2 votes
2 votes

a)a_cb_

b)_abc_

c)abc_ _

d)_ab_c

retagged by

1 Answer

Best answer
5 votes
5 votes

(b)

Since two slots after p are empty, we can think like p is the last enqueued element or two elements are dequeued after p. Hence rear is pointing at p and front is pointing at q.

Contents of the queue after performing the following operations :

1. Enqueue(a)             pa_qr

2. Dequeue                 pa_ _r

3. Enqueue(b)             pab_r

4. Dequeue                 pab_ _

5. Enqueue(c)             pabc_

6. Dequeue                 _abc_

selected by

Related questions

1 votes
1 votes
2 answers
2
srestha asked Oct 29, 2017
2,806 views
The initial configuration of circular queue as followsWhat is status of states of queue contents after the following sequence of stepsenqueue xdequeueenqueue ydequeuedequ...
0 votes
0 votes
0 answers
3
target2017 asked Jan 21, 2017
963 views
Doubt: dequeue really deletes the element or just moves the pointer? I'm not getting the answer.