You are viewing a single comment's thread. Return to all comments →
Python:
class MyQueue(object): # FIFO def __init__(self): self.queue = [] def peek(self): return self.queue[0] def pop(self): if len(self.queue) != 0: return self.queue.pop(0) def put(self, value): self.queue.append(value)
Seems like cookies are disabled on this browser, please enable them to open this website
Queues: A Tale of Two Stacks
You are viewing a single comment's thread. Return to all comments →
Python: