How to make queue from stack?
Anonymous
For this we need 2 stack. During Insertion= In queue insertion occur from rear end so we simple insert the element at top of the stack1. During Deletion= we need to pop all element from stack1 and store all element in another stack2 and then first element of stack1 come in top of the stack2 then we pop the top element from stack2.
Check out your Company Bowl for anonymous work chats.