in Programming edited by
264 views
0 votes
0 votes

The initial configuration of a queue is a, b, c, d (a is in the front). To get the configuration d ,c, b, a, we need minimum number of:

  1. $2$ deletions & $3$ additions
  2. $3$ deletions & $2$ additions
  3. $3$ deletions & $3$ additions
  4. $3$ deletions & $4$ additions
in Programming edited by
by
264 views

1 Answer

1 vote
1 vote
Best answer
The elements of queue are meant to be reversed and we know queue follows FIFO(first in first out) so according to this rule...
abcd ..a will be deleted then b and then c...
d will be left in queue
then c will be added - dc
then b will be added -dcb
then a will be added - dcba
so total no. of deletions and insertions will be 3 and 3 respectively
selected by
Answer:

Related questions