xxxxxxxxxx
enqueue(q, data):
While stack1 is not empty:
Push everything from stack1 to stack2.
Push data to stack1
Push everything back to stack1.
xxxxxxxxxx
Want to crack Data Structure & Algorithms (DSA) interview? Here we compiled the top 50 data structure interview questions and answers asked by top MNCs