Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Hash Table 6
# @param {string} key
# @param {*} value
def set(self, key, value):
keyHash = self.hash(key)
self.keys[key] = keyHash
bucketLinkedList = self.buckets[keyHash]
# custom linkedlist find
node = None
currentNode = bucketLinkedList.head
while not currentNode == None and node == None:
for k in currentNode.value:
if k == key:
node = currentNode
currentNode =
if node == None:
bucketLinkedList.append({key: value})
node.value[key] = value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.