A hash table is a data structure used to implement an associative array (a structure that can map keys to values). It uses a "hash function" to compute an index into an array from which the value can be found.

Hash tables (wikipedia) are part of the standard libraries for many languages:

  • C++: std::unordered_map
  • C# and other .net languages: Dictionary
  • Java: HashMap, ConcurrentHashMap, and others (including the rather aged Hashtable)
  • JavaScript: "Associative Array"
  • Perl: %{hash}
  • Python: "Dictionary"

it is a relatively common exercise in computer science courses to reimplement a hash table from first principles.

history | excerpt history