Queue
Instantiate an empty Queue.
Usage
Queue()
Methods
| Method | Description |
|---|---|
| is_empty | Returns whether a queue is empty |
| peek | Returns the element at the top of the queue |
| dequeue | Returns and remove the element at the front of the queue |
| enqueue | Add an item to the back of the queue |
Example
from jellybeans.structures import Queueq = Queue()q.enqueue(20)q.enqueue(29)print(q) # 20 -> 29