You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Márk Török edited this page Jul 15, 2020
·
2 revisions
Queue
erase
Removes all elements from queue. Precondition : it requires the name of the queue. Example : queue erase fruits
create
It creates a new queue. Precondition : it requires the name of the queue Example : queue create fruits Note : The created queue will be in the global scope. Under the hood it is an array.
dequeue
Removes the next element from the queue. Precondition : it requires the name of the queue. Example : queue dequeue fruits
destroy
It destroys the queue. Precondition : it requires the name of the queue. Example : queue destroy fruits
enqueue
It put an element to queue. Precondition : it requires the name of the queue and the element. Example : queue enqueue fruits apple
empty
Returns whether the queue is empty. Precondition : it requires the name of the queue. Example : queue empty fruits
peek
Returns the next element from the queue. Precondition : it requires the name of the queue. Example : queue peek fruits
size
Returns the number of elements in the queue. Precondition : it requires the name of the queue. Example : queue size fruits