Question: Implement the Queue ADT using circular array approach and test it using assert statements. CircularQueue.py contains skeleton code with a DEFAULT_CAPACITY = 10 class CircularQueue:

Implement the Queue ADT using circular array approach and test it using assert statements. CircularQueue.py contains skeleton code with a DEFAULT_CAPACITY = 10

class CircularQueue:

DEFAULT_CAPACITY = 10

def __init__(self):

""" Creating an empty queue. """

self._data = [None] * self.DEFAULT_CAPACITY

self._size = 0

self._front = 0

def __len__(self):

pass

def is_empty(self):

pass

def first(self):

""" Return (but do not remove) the first element of the queue. """

pass

def dequeue(self):

" Remove and return the first element of the queue. (FIFO)"

pass

def enqueue(self, e):

pass

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!