The idea is to Reverse a Queue using a Stack
Queue works in the FIFO fashion Stacks works in - LIFO fashion
you have some Queue let say = q1
1 --> 2 --> 3 --> 4
Reverse : 4 --> 3 --> 2 --> 1
- pop all the elements from the q1
- push poped elements into the Stack s1
- Now the q1 will be empty
- Pop all the elements from the Stack s1 till it become empty
- place the poped elements back into the Queue q1