Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 1.21 KB

class401-24.md

File metadata and controls

27 lines (24 loc) · 1.21 KB

Hash Tables

Intro

  • hash tables are also known as hash maps
  • hash tables are used to store key value pairs
    • keys are not ordered
  • fast for...
    • finding values, adding new values, and removing values
  • nearly ever language has a sort of hash table data structure
    • Python = Dictionaries
    • JS = Objects & Maps
    • Java|Go|Scala = Maps
    • Ruby = Hashes
  • becuase of speed, they are commonly used
  • uses human readable keys

Hashing Algorithm

  • need to convert human readable string into a number using hash functions
  • should be deterministic: pass in a string and return the same number everytime (that will then be used as the index to store the key value pair in an array.)
  • needs to be fast (constant time) to read and write
  • shouldn't cluster outputs at specific indices (say in the mean )

Resources