-
-
Save amankharwal/212f8ec9bd6a0748b13865cd3e605709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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