All pastes #39631 Raw Edit

Unnamed

public text v1 · immutable
#39631 ·published 2006-02-02 16:24 UTC
rendered paste body
Algorithm 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()