{
  "schema_version": "1.0",
  "codex": "thecodex.expert/coding",
  "type": "concept",
  "slug": "concepts/recursion",
  "name": "Recursion",
  "section": "CS Concepts",
  "canonical_definition": "Recursion is a programming technique in which a function calls itself as part of its own definition, solving a problem by reducing it to a smaller instance of the same problem, with a base case that terminates the chain of self-calls and returns a concrete value without further recursion.",
  "confidence": "high",
  "last_verified": "2026-06-01",
  "source_count": 4,
  "url": "https://thecodex.expert/coding/concepts/recursion/",
  "concept_relationship": {
    "requires_first": [
      "concepts/functions",
      "concepts/control-flow"
    ],
    "enables": [
      "algorithms/sorting",
      "data-structures/trees",
      "algorithms/dynamic-programming"
    ],
    "commonly_confused_with": [
      "recursion != iteration (stack frames vs. one frame)",
      "no base case = crash",
      "tail recursion not optimised in Python/Java/JS"
    ]
  }
}