Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created March 20, 2021 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/4bb73d6689d099ac02addde009adb538 to your computer and use it in GitHub Desktop.
Save amankharwal/4bb73d6689d099ac02addde009adb538 to your computer and use it in GitHub Desktop.
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