You are viewing a single comment's thread. Return to all comments →
Do you want to reverse to get the front item while using pop and push? No need for that : shift() and unshift() are your friends.
Seems like cookies are disabled on this browser, please enable them to open this website
Queues: A Tale of Two Stacks
You are viewing a single comment's thread. Return to all comments →
Do you want to reverse to get the front item while using pop and push? No need for that : shift() and unshift() are your friends.