Consider you have a stack whose elements in it are as follows. 5 4 3 2 << top Where the top element is 2. You need to get the following stack 6 5 4 3 2 << top The operations that needed to be performed are (You can perform only push and pop):

Correct Answer: Push(pop()), push(6), push(pop())
By performing push(pop()) on all elements on the current stack to the next stack you get 2 3 4 5 << top.Push(6) and perform push(pop()) you’ll get back 6 5 4 3 2 << top. You have actually performed enQueue operation using push and pop.