Melvin's digital garden

Queue with two stacks

Not only a theoretical exercise for amortize analysis, can be useful in practice as well.

Turing two physical stacks of T-shirts into a queue.

See https://pozorvlak.livejournal.com/164716.html

Links to this note