Data Structures & Algorithms in Swift, Episode 5: Queue | Kodeco, the new raywenderlich.com

Queues use first-in-first-out (FIFO) ordering, meaning the first element that was enqueued will be the first to get dequeued.


This is a companion discussion topic for the original entry at https://www.kodeco.com/977854-data-structures-algorithms-in-swift/lessons/5

Thanks for this great session.
I have a question about the big(O) for the Queue implementation with double stacks … shouldn’t the dequeue complexity be O(n) not O(1) … since we are moving all enqueue stack elements to another array ?