Skip to content

Instantly share code, notes, and snippets.

@dmwyatt
Created October 17, 2021 17:11
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 dmwyatt/903a97dee1869dd2ce8fe9afe57f4a54 to your computer and use it in GitHub Desktop.
Save dmwyatt/903a97dee1869dd2ce8fe9afe57f4a54 to your computer and use it in GitHub Desktop.
[SetQueue] A Queue that behaves like a Set #datastructure
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