16 lines
248 B
Text
16 lines
248 B
Text
|
|
sequence queue = {}
|
||
|
|
|
||
|
|
procedure push(object what)
|
||
|
|
queue = append(queue,what)
|
||
|
|
end procedure
|
||
|
|
|
||
|
|
function pop()
|
||
|
|
object what = queue[1]
|
||
|
|
queue = queue[2..$]
|
||
|
|
return what
|
||
|
|
end function
|
||
|
|
|
||
|
|
function empty()
|
||
|
|
return length(queue)=0
|
||
|
|
end function
|