Created
October 17, 2021 17:11
-
-
Save dmwyatt/903a97dee1869dd2ce8fe9afe57f4a54 to your computer and use it in GitHub Desktop.
[SetQueue] A Queue that behaves like a Set #datastructure
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 SetQueue(Queue): | |
def _init(self, maxsize): | |
self.queue = set() | |
def _put(self, item): | |
self.queue.add(item) | |
def _get(self): | |
return self.queue.pop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment