when we are popping elements from queue 1 and inserting into q2 during pop operation thn how is it working? queue works on Fifo principle
About the implementation of the push function
we want to implement stack using queue
we are considering queue1 as our stack
so when we have to push the element we push in q1
but when we have to pop then according to stack poped element should be last one but in queue you can only pop first element
so you transfer the element of q1 to q2