Skip to content

Instantly share code, notes, and snippets.

@amankharwal

amankharwal/queues.py Secret

Created Mar 2, 2021
Embed
What would you like to do?
class queue:
def __init__(self):
self.items = []
def is_empty(self):
return self.items == []
def enqueue(self, item):
self.items.insert(0, item)
def dequeue(self):
return self.items.pop()
def size(self):
return len(self.items)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment