6,696 views
1 votes
1 votes

 The initial configuration of queue is a, b, c, d. ‘a’ is at the front. To get the configuration d, c, b, a how many deletions and additions required:

(A) 2 deletions, 3 additions   

(B) 3 deletions, 2 additions

(C) 3 deletions, 4 additions   

(D) 3 deletions, 3 additions

1 Answer

1 votes
1 votes

@akankshadewangan24 here answer should be option D. But I would like to say  here that if the queue is implemented using single linked list or in any data structure for that matter, then one could have swapped the FRONT and REAR pointer which would give the desired output. In that case, no addition or deletion is required :D

Related questions

2 votes
2 votes
2 answers
1
1 votes
1 votes
1 answer
3