why we are changing reference primary variable to secondary array after dequing element how it will help to save the data of an array means how it will help to keep the data from being lost
Switching from primary to secondary
hey @dheerajmishra992
Let 1 2 3 4 5 6
1 2 3 4 5 enqueue in the primary queue.
then pop an element from the stack.
The primary queue will be empty after the pop operation.
Then 6 enqueue in the primary queue without swapping references.
The primary queue will contain only 6