/hash_table

My own basic hash table (dictionary) implementation in Python.

Primary LanguagePython

hash_table

My own basic hash table (dictionary) implementation in Python.

Must have the following features:

  • Create an empty hash table
  • Insert key-value pair
  • Update a key-value value
  • Get a given key's value
  • Delete a key-value pair
  • Check if hash table has a given key
  • Create a shallow copy
  • Return default if key not found
  • Report number of key-value pairs stored
  • Must be iterable
  • Comparable using equality test
  • Show textual representation

Must have the following attributes:

  • Unique keys
  • Non-unique values
  • Universal input
  • Fixed-size output
  • Deterministic
  • Fast to compute

References: