{
  "schema_version": "1.0",
  "codex": "thecodex.expert/coding",
  "type": "data-structure",
  "slug": "data-structures/hash-tables",
  "name": "Hash Tables",
  "section": "Data Structures",
  "canonical_definition": "A hash table is a data structure that maps keys to values by applying a hash function to each key to compute a bucket index, providing O(1) average-case lookup, insertion, and deletion at the cost of O(n) worst-case when collisions are uncontrolled.",
  "complexity": {
    "search": "O(1) avg / O(n) worst",
    "insert": "O(1) avg / O(n) worst",
    "delete": "O(1) avg / O(n) worst",
    "space": "O(n)"
  },
  "confidence": "high",
  "last_verified": "2026-06-01",
  "source_count": 4,
  "url": "https://thecodex.expert/coding/data-structures/hash-tables/",
  "concept_relationship": {
    "requires_first": [
      "concepts/objects",
      "concepts/arrays"
    ],
    "enables": [
      "algorithms/searching",
      "data-structures/arrays"
    ],
    "commonly_confused_with": [
      "O(1) is average not worst",
      "dict != hash table exactly (dict is a language-level hash table)",
      "Python dict order guaranteed since 3.7"
    ]
  },
  "sources": [
    {
      "num": 1,
      "citation": "CLRS 4th ed. Ch.11",
      "tier": 1
    },
    {
      "num": 2,
      "citation": "Carter & Wegman 1979 JCSS 18(2)",
      "tier": 1
    },
    {
      "num": 3,
      "citation": "PEP 456",
      "tier": 1
    },
    {
      "num": 4,
      "citation": "OpenJDK HashMap source",
      "tier": 1
    }
  ]
}