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.
Hope my words will not spoil the challenge.
You can think to maintain the queue data by combination of the two stacks' data, not full copy them in each one when the operation is pop() or front().
Queues: A Tale of Two Stacks
You are viewing a single comment's thread. Return to all comments →
Hope my words will not spoil the challenge. You can think to maintain the queue data by combination of the two stacks' data, not full copy them in each one when the operation is pop() or front().