We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
There is a really easy way to do this if you use an array, but it can be very ineffient for larger queues. Here what I suggest using as a framework for python code in order to actually try out coding with 2 stacks to simulate a proper queue:
Queue using Two Stacks
You are viewing a single comment's thread. Return to all comments →
There is a really easy way to do this if you use an array, but it can be very ineffient for larger queues. Here what I suggest using as a framework for python code in order to actually try out coding with 2 stacks to simulate a proper queue: