Hashtables - andrewkyllo-401-advanced-javascript/seattle-javascript-401d34 GitHub Wiki

  1. Hash - The result of an algorithm that converts a string into a value that could be used for either security or some other purpose
  2. Buckets - Contained in each index of the array of hashtable.
  3. Collisions - When more than one key gets hashed to the same location of a hashtable
  • These are used because they hold unique values and are analogous to a dictionary and library
  • Hashtables are a data structure that utilize key value pairs
  • Allows you to search for data in O(1)

Structure

Hashing

  • A hash code turns a key into an integer. The same key should always product the same hash code

Creating a Hash

  • A hashtable traditionally is created from an array