two-stack-queue-amortized-via-lazy-transfer

Status: IN

The two-stack queue achieves correct FIFO semantics with amortized O(1) per operation through lazy bulk transfer: each element crosses from input to output stack exactly once across its lifetime, push is worst-case O(1) (never triggers transfer), and the deferred reversal preserves total ordering.

Justifications

Three properties of the two-stack queue collectively prove amortized O(1) via the lazy-transfer mechanism

Depends on (SL): two-stack-queue-amortized-o1, two-stack-queue-lazy-transfer, two-stack-queue-push-always-o1

JSON