{
  "schema_version": "1.0",
  "codex": "thecodex.expert/coding",
  "type": "data-structure",
  "slug": "data-structures/binary-search-trees",
  "name": "Binary Search Trees",
  "confidence": "high",
  "last_verified": "2026-06-01",
  "url": "https://thecodex.expert/coding/data-structures/binary-search-trees/",
  "canonical_definition": "A binary search tree (BST) is a binary tree where each node key > all keys in its left subtree and < all in its right subtree \u2014 O(log n) average search, insert, delete; O(n) in-order traversal yields sorted output.",
  "complexity": {
    "search_avg": "O(log n)",
    "search_worst": "O(n)",
    "insert_avg": "O(log n)",
    "delete_avg": "O(log n)",
    "inorder": "O(n)",
    "space": "O(n)"
  },
  "concept_relationship": {
    "requires_first": [
      "concepts/recursion",
      "data-structures/linked-lists"
    ],
    "enables": [
      "algorithms/searching/binary-search"
    ]
  },
  "sources": [
    {
      "num": 1,
      "citation": "CLRS 4th ed. Ch.12 & Ch.13",
      "tier": 1
    },
    {
      "num": 2,
      "citation": "Adelson-Velsky & Landis 1962",
      "tier": 1
    },
    {
      "num": 3,
      "citation": "Guibas & Sedgewick 1978 FOCS",
      "tier": 1
    },
    {
      "num": 4,
      "citation": "Knuth TAOCP Vol.3 \u00a76.2.3",
      "tier": 1
    }
  ]
}