Function queue::pop()

← Back to Class queue



Module adtClass queue → pop()

Description

Retrieve and remove the head of the Queue, or return nothing if the Queue is empty

queue::pop()


Parameters

There are no parameters.


Return Value


Usage Example

import adt/queue
 
queue = queue()
 
queue.push(10)
queue.push(12)
queue.push(8)
 
writeln(queue.pop())   ' Output: 10
writeln(queue.pop())   ' Output: 12
writeln(queue.pop())   ' Output: 8
writeln(queue.pop())   ' Output: nothing