class documentation

class ArrayQueue:

View In Hierarchy

FIFO queue implementation using a Python list as underlying storage.

Method __init__ Create an empty queue.
Method __len__ Return the number of elements in the queue.
Method dequeue Remove and return the first element of the queue (i.e., FIFO).
Method enqueue Add an element to the back of queue.
Method first Return (but do not remove) the element at the front of the queue.
Method is_empty Return True if the queue is empty.
Constant DEFAULT_CAPACITY Undocumented
Method _resize Resize to a new list of capacity >= len(self).
Instance Variable _data Undocumented
Instance Variable _f Undocumented
Instance Variable _size Undocumented
def __init__(self):

Create an empty queue.

def __len__(self):

Return the number of elements in the queue.

def dequeue(self):

Remove and return the first element of the queue (i.e., FIFO).

Raise Empty exception if the queue is empty.

def enqueue(self, e):

Add an element to the back of queue.

def first(self):

Return (but do not remove) the element at the front of the queue.

Raise Empty exception if the queue is empty.

def is_empty(self):

Return True if the queue is empty.

DEFAULT_CAPACITY: int =

Undocumented

Value
10
def _resize(self, cap):

Resize to a new list of capacity >= len(self).

_data =

Undocumented

_f: int =

Undocumented

_size: int =

Undocumented