DEV Community

Discussion on: Implementing Queue with 2 Stacks

Collapse
 
pentacular profile image
pentacular

The nice thing is that you get an amortized O(1) TC and using linked lists for the stacks makes it appropriate for a purely functional implementation, if you're into that kind of thing.