Push in first one

I don’t understand push operation in the first case. Please help me regarding that.

In stack the the element being pushed in the last is the element popped out first but it is opposite in queues so thats why we push the latest element first then the rest of the element in this way the latest element will be the first one to pop out of queue thus satisfying the condition of a stack.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.