Skip to content

Instantly share code, notes, and snippets.

@AdamGold
Last active March 24, 2019 12:45
Show Gist options
  • Save AdamGold/62eaa67ce4b79687fb475717f89b04a1 to your computer and use it in GitHub Desktop.
Save AdamGold/62eaa67ce4b79687fb475717f89b04a1 to your computer and use it in GitHub Desktop.
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