{
  "slug": "subsets-backtracking",
  "title": "Backtracking — All Subsets",
  "category": "Recursion & DP",
  "difficulty": "medium",
  "complexity": {
    "time": "O(2ⁿ)",
    "space": "O(n)"
  },
  "idea": "For each element in turn you make one binary choice — leave it out (–) or take it. Every root-to-leaf path spells one subset, and n elements give 2ⁿ leaves. Backtracking simply means undoing a choice and trying the other branch.",
  "code": [
    "build(i, chosen):",
    "    if i == n: record chosen; return",
    "    build(i+1, chosen)          # leave a[i] out",
    "    build(i+1, chosen + [a[i]]) # take a[i]"
  ],
  "example": {
    "array": [
      1,
      2,
      3
    ]
  },
  "invariant": "Each step is the real data structure at that step — the picture is a pure function of it.",
  "stepCount": 17,
  "steps": [
    {
      "i": 0,
      "op": "tree",
      "caption": "For each element, branch twice: leave it out (–) on the left, take it on the right.",
      "note": null,
      "codeLine": 1,
      "stats": null,
      "nodes": []
    },
    {
      "i": 1,
      "op": "tree",
      "caption": "Decide about 1.",
      "note": null,
      "codeLine": 1,
      "stats": null,
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 2,
      "op": "tree",
      "caption": "Decide about 2.",
      "note": null,
      "codeLine": 1,
      "stats": null,
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 3,
      "op": "tree",
      "caption": "Decide about 3.",
      "note": null,
      "codeLine": 1,
      "stats": null,
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 4,
      "op": "tree",
      "caption": "End of the line — this path spells { }.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 1
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 5,
      "op": "tree",
      "caption": "End of the line — this path spells {3}.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 2
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 6,
      "op": "tree",
      "caption": "Decide about 3.",
      "note": null,
      "codeLine": 1,
      "stats": {
        "subsets": 2
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 7,
      "op": "tree",
      "caption": "End of the line — this path spells {2}.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 3
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 8,
      "op": "tree",
      "caption": "End of the line — this path spells {2,3}.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 4
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 9,
      "op": "tree",
      "caption": "Decide about 2.",
      "note": null,
      "codeLine": 1,
      "stats": {
        "subsets": 4
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "1",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 10,
      "op": "tree",
      "caption": "Decide about 3.",
      "note": null,
      "codeLine": 1,
      "stats": {
        "subsets": 4
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "1",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t8",
          "side": "left",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 11,
      "op": "tree",
      "caption": "End of the line — this path spells {1}.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 5
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "1",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t8",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "–",
          "text": "{1}",
          "parent": "t9",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 12,
      "op": "tree",
      "caption": "End of the line — this path spells {1,3}.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 6
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "1",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t8",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "–",
          "text": "{1}",
          "parent": "t9",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 3,
          "label": "3",
          "text": "{1,3}",
          "parent": "t9",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 13,
      "op": "tree",
      "caption": "Decide about 3.",
      "note": null,
      "codeLine": 1,
      "stats": {
        "subsets": 6
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "1",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t8",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "–",
          "text": "{1}",
          "parent": "t9",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 3,
          "label": "3",
          "text": "{1,3}",
          "parent": "t9",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t8",
          "side": "right",
          "focus": "read",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 14,
      "op": "tree",
      "caption": "End of the line — this path spells {1,2}.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 7
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "1",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t8",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "–",
          "text": "{1}",
          "parent": "t9",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 3,
          "label": "3",
          "text": "{1,3}",
          "parent": "t9",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t8",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 3,
          "label": "–",
          "text": "{1,2}",
          "parent": "t12",
          "side": "left",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 15,
      "op": "tree",
      "caption": "End of the line — this path spells {1,2,3}.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 8
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "1",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t8",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "–",
          "text": "{1}",
          "parent": "t9",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 3,
          "label": "3",
          "text": "{1,3}",
          "parent": "t9",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t8",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 3,
          "label": "–",
          "text": "{1,2}",
          "parent": "t12",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t14",
          "value": 3,
          "label": "3",
          "text": "{1,2,3}",
          "parent": "t12",
          "side": "right",
          "focus": "settled",
          "badges": [
            "cur"
          ]
        }
      ]
    },
    {
      "i": 16,
      "op": "tree",
      "caption": "8 leaves, so 8 subsets — exactly 2^3.",
      "note": null,
      "codeLine": 2,
      "stats": {
        "subsets": 8
      },
      "nodes": [
        {
          "id": "t0",
          "value": 0,
          "label": "start",
          "text": null,
          "parent": null,
          "side": null,
          "focus": null,
          "badges": null
        },
        {
          "id": "t1",
          "value": 1,
          "label": "–",
          "text": null,
          "parent": "t0",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t2",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t1",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t3",
          "value": 3,
          "label": "–",
          "text": "{ }",
          "parent": "t2",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t4",
          "value": 3,
          "label": "3",
          "text": "{3}",
          "parent": "t2",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t5",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t1",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t6",
          "value": 3,
          "label": "–",
          "text": "{2}",
          "parent": "t5",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t7",
          "value": 3,
          "label": "3",
          "text": "{2,3}",
          "parent": "t5",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t8",
          "value": 1,
          "label": "1",
          "text": null,
          "parent": "t0",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t9",
          "value": 2,
          "label": "–",
          "text": null,
          "parent": "t8",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t10",
          "value": 3,
          "label": "–",
          "text": "{1}",
          "parent": "t9",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t11",
          "value": 3,
          "label": "3",
          "text": "{1,3}",
          "parent": "t9",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t12",
          "value": 2,
          "label": "2",
          "text": null,
          "parent": "t8",
          "side": "right",
          "focus": null,
          "badges": null
        },
        {
          "id": "t13",
          "value": 3,
          "label": "–",
          "text": "{1,2}",
          "parent": "t12",
          "side": "left",
          "focus": null,
          "badges": null
        },
        {
          "id": "t14",
          "value": 3,
          "label": "3",
          "text": "{1,2,3}",
          "parent": "t12",
          "side": "right",
          "focus": null,
          "badges": null
        }
      ]
    }
  ]
}