Unnamed
public text v1 · immutableAlgorithm enqueue(o)
in_stack.push(o)
Algorithm dequeue()
if (out_stack.isEmpty()) then
while (!in_stack.isEmpty()) do
out_stack.push(in_stack.pop())
if (out_stack.isEmpty()) then
throw a QueueEmptyException
return out_stack.pop()