To perform insertion and deletion in queue we have 2 variable called $\text{Front, Rear.}$
- Front: Front is a variable which contain position of element to be deleted.
- Rear: Rear is a variable which contain position of element to be inserted.
Now according to the current queue:
Delete $a$:
Delete $b$:
Delete $c$:
$-$ |
$-$ |
$-$ |
$d$ (front,rear) |
to achieve $d,c,b,a$ we have to perform 3 insertion;
Insert $c$:
Insert $b$:
insert $a$:
$d$(front) |
$c$ |
$b$ |
$a$(rear) |
To get configuration $d,c,b,a$ we required $3$ deletion and $3$ insertion operation.
So option $D$ is correct.