Last active
July 19, 2023 15:06
-
-
Save tjarratt/a4c2d86e15136f7782275cc7cafca9cc to your computer and use it in GitHub Desktop.
Basic set implementation in python
This file contains hidden or 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 ListSet: | |
def __init__(self): | |
self._values = [] | |
self.__index = 0 | |
def add(self, value): | |
if value in self._values: | |
return | |
self._values.append(value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment