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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started