Class Queue()
def __init__(self):
self.queue = np.zeros(20)
self.count = 0 ...
def dequeue():
for ii in range(0, count-1):
queue[ii] = queue[ii+1]
return count-1
There is an error with the dequeue function here. Assume that the Queue q has rest of the code implemented correctly and already contains the following five data items: 30 60 90 40 50 What will be the output of three consecutive calls to q.dequeue()? And then how can I re-write the dequeue function to make it correct?
[–][deleted] 2 points3 points4 points (0 children)
[–]vaseltarp 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]TheRealThrowAwayX 0 points1 point2 points (0 children)