You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# In this sort of normal Queue, we can insert elements until queue becomes full. But once queue becomes full, we can not insert the next element even if there is a space in front of queue.
classQueue:
def__init__(self,size):
self.size=size
self.head=-1
self.tail=-1
self.array= [None] *size
defisEmpty(self):
if (self.head==-1&self.tail==-1):
returnTrue
else:
returnFalse
defpeek(self):
ifself.head>=0:
print('First data in queue is : '+str(self.array[self.head]))