stack-queue-costly-push-strategy

Status: IN

Push is O(n) due to rotating n-1 elements behind the new element; pop, top, and empty are all O(1). This is the costly-push variant, preferred when reads outnumber writes.

Source: entries/2026/06/06/implement-stack-using-queues-solution.md

JSON