{
  "slug": "recursion-fibonacci",
  "title": "Recursion — Fibonacci Call Tree",
  "category": "Recursion & DP",
  "difficulty": "medium",
  "complexity": {
    "time": "O(2ⁿ)",
    "space": "O(n)"
  },
  "idea": "Plain recursive Fibonacci calls itself twice per node, so the call tree branches exponentially. Identical subtrees appear over and over — the same f(2) is computed from scratch several times. That repeated work is exactly what memoisation and DP remove.",
  "code": [
    "f(n):",
    "    if n <= 1: return n",
    "    return f(n-1) + f(n-2)"
  ],
  "example": {
    "array": [],
    "target": 5
  },
  "invariant": "Each step is the real data structure at that step — the picture is a pure function of it.",
  "stepCount": 32,
  "steps": [
    {
      "i": 0,
      "op": "tree",
      "caption": "Compute f(5) by plain recursion — every call spawns two more.",
      "note": null,
      "codeLine": 1,
      "stats": null,
      "nodes": []
    },
    {
      "i": 1,
      "op": "tree",
      "caption": "Call f(5).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 1
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 2,
      "op": "tree",
      "caption": "Call f(4).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 2
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 3,
      "op": "tree",
      "caption": "Call f(3).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 3
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 4,
      "op": "tree",
      "caption": "Call f(2).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 4
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t2",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 5,
      "op": "tree",
      "caption": "Call f(1).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 5
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": null,
          "parent": "t3",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 6,
      "op": "tree",
      "caption": "f(1) is a base case — it returns 1 immediately.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "calls": 5
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 7,
      "op": "tree",
      "caption": "Call f(0).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 6
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": null,
          "parent": "t3",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 8,
      "op": "tree",
      "caption": "f(0) is a base case — it returns 0 immediately.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "calls": 6
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 9,
      "op": "tree",
      "caption": "Both halves are back: f(2) = 1 + 0 = 1.",
      "note": null,
      "codeLine": 3,
      "stats": {
        "calls": 6
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    },
    {
      "i": 10,
      "op": "tree",
      "caption": "Call f(1).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 7
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": null,
          "parent": "t2",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 11,
      "op": "tree",
      "caption": "f(1) is a base case — it returns 1 immediately.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "calls": 7
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 12,
      "op": "tree",
      "caption": "Both halves are back: f(3) = 1 + 1 = 2.",
      "note": null,
      "codeLine": 3,
      "stats": {
        "calls": 7
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    },
    {
      "i": 13,
      "op": "tree",
      "caption": "Call f(2).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 8
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 14,
      "op": "tree",
      "caption": "Call f(1).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 9
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": null,
          "parent": "t7",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 15,
      "op": "tree",
      "caption": "f(1) is a base case — it returns 1 immediately.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "calls": 9
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 16,
      "op": "tree",
      "caption": "Call f(0).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 10
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": null,
          "parent": "t7",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 17,
      "op": "tree",
      "caption": "f(0) is a base case — it returns 0 immediately.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "calls": 10
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 18,
      "op": "tree",
      "caption": "Both halves are back: f(2) = 1 + 0 = 1.",
      "note": null,
      "codeLine": 3,
      "stats": {
        "calls": 10
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    },
    {
      "i": 19,
      "op": "tree",
      "caption": "Both halves are back: f(4) = 2 + 1 = 3.",
      "note": null,
      "codeLine": 3,
      "stats": {
        "calls": 10
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    },
    {
      "i": 20,
      "op": "tree",
      "caption": "Call f(3).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 11
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 21,
      "op": "tree",
      "caption": "Call f(2).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 12
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t10",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 22,
      "op": "tree",
      "caption": "Call f(1).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 13
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": null,
          "parent": "t11",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 23,
      "op": "tree",
      "caption": "f(1) is a base case — it returns 1 immediately.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "calls": 13
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 24,
      "op": "tree",
      "caption": "Call f(0).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 14
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 0,
          "label": "f(0)",
          "text": null,
          "parent": "t11",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 25,
      "op": "tree",
      "caption": "f(0) is a base case — it returns 0 immediately.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "calls": 14
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": null,
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t11",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 26,
      "op": "tree",
      "caption": "Both halves are back: f(2) = 1 + 0 = 1.",
      "note": null,
      "codeLine": 3,
      "stats": {
        "calls": 14
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t10",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t11",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    },
    {
      "i": 27,
      "op": "tree",
      "caption": "Call f(1).",
      "note": null,
      "codeLine": 1,
      "stats": {
        "calls": 15
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t11",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t14",
          "value": 1,
          "label": "f(1)",
          "text": null,
          "parent": "t10",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 28,
      "op": "tree",
      "caption": "f(1) is a base case — it returns 1 immediately.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "calls": 15
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t11",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t14",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t10",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 29,
      "op": "tree",
      "caption": "Both halves are back: f(3) = 1 + 1 = 2.",
      "note": null,
      "codeLine": 3,
      "stats": {
        "calls": 15
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t0",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t11",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t14",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t10",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    },
    {
      "i": 30,
      "op": "tree",
      "caption": "Both halves are back: f(5) = 3 + 2 = 5.",
      "note": null,
      "codeLine": 3,
      "stats": {
        "calls": 15
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": "= 5",
          "parent": null,
          "side": null,
          "focus": "settled",
          "badges": [
            "cur"
          ]
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t11",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t14",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t10",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    },
    {
      "i": 31,
      "op": "tree",
      "caption": "f(5) = 5 after 15 calls. f(1) alone was computed 5 separate times — that is the waste DP removes.",
      "note": null,
      "codeLine": 3,
      "stats": {
        "calls": 15
      },
      "nodes": [
        {
          "id": "t0",
          "value": 5,
          "label": "f(5)",
          "text": "= 5",
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 4,
          "label": "f(4)",
          "text": "= 3",
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t3",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t3",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t7",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t7",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "f(3)",
          "text": "= 2",
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 2,
          "label": "f(2)",
          "text": "= 1",
          "parent": "t10",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t11",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 0,
          "label": "f(0)",
          "text": "= 0",
          "parent": "t11",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t14",
          "value": 1,
          "label": "f(1)",
          "text": "= 1",
          "parent": "t10",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    }
  ]
}