SyntaxFix
Write A Post
Hire A Developer
Questions
As has been mentioned, wouldn't a single queue do the trick? It's probably less practical but is a bit slicker.
push(x): enqueue(x) for(queueSize - 1) enqueue(dequeue()) pop(x): dequeue()