Question: Queue The class should own (as an instance variable) an instance of ArrayDeque or LinkedList and implement its own operations only with forwarding calls to


Queue The class should own (as an instance variable) an instance of ArrayDeque or LinkedList and implement its own operations only with forwarding calls to the operations of the encapsulated container. Implement the class Queue, including the following operations: add Takes a parameter and adds its value to the back of the queue remove Removes the item off the front of the queue and returns its value If the queue is empty, return None get_size Returns the number of items currently in the queue o o o Bonus 5% will be given for solutions where push, pop, add and remove are all implemented with the best time complexities possible. from array_deque import ArrayDeque from my_linked_list import Linkedlist class Queue: def __init__(self): # Pick one of these to use. # Stack must have the container you dont choose for Queue #self.container = Linkedlist() #self.container = ArrayDeque () pass def add(self, data): pass def remove(self): pass def get_size(self): return def_str_(self): return
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
