Last active
March 24, 2019 12:45
-
-
Save AdamGold/62eaa67ce4b79687fb475717f89b04a1 to your computer and use it in GitHub Desktop.
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 HashTable(object): | |
def __init__(self, size): | |
"""initialise hash table""" | |
def __getitem__(self, key: str) -> Entry: | |
"""subscript method - object[key] | |
use hashing function to find the index""" | |
def __setitem__(self, key: str, value: Any) -> int: | |
"""allow insertion of items with object[key] = value""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment