structure v0.2.2 Structure.Queue View Source
Efficient double ended fifo queue
Link to this section Summary
Functions
Returns if the queue is empty
Create queue from list
Returns length of the queue
Returns if element is in the queue
Create a new empty queue
Pop an item from the rear of the queue
Pop an item from the front of the queue
Push an item at the end of the queue
Push an item at the front of the queue
Returns the items in the queue as a list
Link to this section Types
Link to this section Functions
Returns if the queue is empty.
O(1)
Create queue from list.
O(length(l))
Returns length of the queue.
O(len(q))
Returns if element is in the queue.
O(len(q)) worst case
Create a new empty queue.
O(1)
Pop an item from the rear of the queue.
O(1) amortized. O(len(q)) worst case.
Pop an item from the front of the queue.
O(1) amortized. O(len(q)) worst case.
Push an item at the end of the queue.
O(1)
Push an item at the front of the queue.
O(1)
Returns the items in the queue as a list.
O(len(q))