{
  "slug": "selection-sort",
  "title": "Selection Sort",
  "category": "Sorting",
  "difficulty": "easy",
  "complexity": {
    "time": "O(n²)",
    "space": "O(1)"
  },
  "idea": "Scan the unsorted part for the minimum, swap it to the front of that part, and grow a sorted prefix from the left.",
  "code": [
    "for i in 0 .. n-1:",
    "    m = i",
    "    for j in i+1 .. n-1:",
    "        if a[j] < a[m]: m = j",
    "    swap a[i], a[m]"
  ],
  "example": {
    "array": [
      7,
      3,
      8,
      2,
      9,
      4
    ]
  },
  "invariant": "Each step is the real data structure at that step — the picture is a pure function of it.",
  "stepCount": 40,
  "steps": [
    {
      "i": 0,
      "op": "say",
      "caption": "Repeatedly pick the smallest of what remains and place it next.",
      "note": null,
      "codeLine": 1,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        null,
        null,
        null,
        null,
        null,
        null
      ],
      "markers": [],
      "regions": []
    },
    {
      "i": 1,
      "op": "candidate",
      "caption": "Assume index 0 (7) is the smallest for now.",
      "note": null,
      "codeLine": 2,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        "candidate",
        null,
        null,
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        }
      ],
      "regions": []
    },
    {
      "i": 2,
      "op": "compare",
      "caption": "Is 3 smaller than the best so far, 7?",
      "note": "yes → new best",
      "codeLine": 4,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        "compare",
        "compare",
        null,
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 1,
          "tone": "compare"
        }
      ],
      "regions": []
    },
    {
      "i": 3,
      "op": "candidate",
      "caption": "3 is the new smallest.",
      "note": null,
      "codeLine": 4,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        null,
        "candidate",
        null,
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 1,
          "tone": "compare"
        }
      ],
      "regions": []
    },
    {
      "i": 4,
      "op": "compare",
      "caption": "Is 8 smaller than the best so far, 3?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        null,
        "compare",
        "compare",
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 2,
          "tone": "compare"
        }
      ],
      "regions": []
    },
    {
      "i": 5,
      "op": "compare",
      "caption": "Is 2 smaller than the best so far, 3?",
      "note": "yes → new best",
      "codeLine": 4,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        null,
        "compare",
        null,
        "compare",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 3,
          "tone": "compare"
        }
      ],
      "regions": []
    },
    {
      "i": 6,
      "op": "candidate",
      "caption": "2 is the new smallest.",
      "note": null,
      "codeLine": 4,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        null,
        null,
        null,
        "candidate",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 3,
          "tone": "compare"
        }
      ],
      "regions": []
    },
    {
      "i": 7,
      "op": "compare",
      "caption": "Is 9 smaller than the best so far, 2?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        null,
        null,
        null,
        "compare",
        "compare",
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 4,
          "tone": "compare"
        }
      ],
      "regions": []
    },
    {
      "i": 8,
      "op": "compare",
      "caption": "Is 4 smaller than the best so far, 2?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        7,
        3,
        8,
        2,
        9,
        4
      ],
      "focus": [
        null,
        null,
        null,
        "compare",
        null,
        "compare"
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": []
    },
    {
      "i": 9,
      "op": "swap",
      "caption": "Swap the smallest (2) into index 0.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        "swap",
        null,
        null,
        "swap",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": []
    },
    {
      "i": 10,
      "op": "settle",
      "caption": "Index 0 is locked in.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        "settled",
        null,
        null,
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 0,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 0,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 11,
      "op": "candidate",
      "caption": "Assume index 1 (3) is the smallest for now.",
      "note": null,
      "codeLine": 2,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        "candidate",
        null,
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 1,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 0,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 12,
      "op": "compare",
      "caption": "Is 8 smaller than the best so far, 3?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        "compare",
        "compare",
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 1,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 2,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 0,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 13,
      "op": "compare",
      "caption": "Is 7 smaller than the best so far, 3?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        "compare",
        null,
        "compare",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 1,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 3,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 0,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 14,
      "op": "compare",
      "caption": "Is 9 smaller than the best so far, 3?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        "compare",
        null,
        null,
        "compare",
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 1,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 4,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 0,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 15,
      "op": "compare",
      "caption": "Is 4 smaller than the best so far, 3?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        "compare",
        null,
        null,
        null,
        "compare"
      ],
      "markers": [
        {
          "name": "i",
          "index": 1,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 0,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 16,
      "op": "settle",
      "caption": "3 is already the smallest — it stays.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        "settled",
        null,
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 1,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 0,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 17,
      "op": "settle",
      "caption": "Index 1 is locked in.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        "settled",
        null,
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 1,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 1,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 18,
      "op": "candidate",
      "caption": "Assume index 2 (8) is the smallest for now.",
      "note": null,
      "codeLine": 2,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        null,
        "candidate",
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 2,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 1,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 19,
      "op": "compare",
      "caption": "Is 7 smaller than the best so far, 8?",
      "note": "yes → new best",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        null,
        "compare",
        "compare",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 2,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 3,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 1,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 20,
      "op": "candidate",
      "caption": "7 is the new smallest.",
      "note": null,
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        null,
        null,
        "candidate",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 2,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 3,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 1,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 21,
      "op": "compare",
      "caption": "Is 9 smaller than the best so far, 7?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        null,
        null,
        "compare",
        "compare",
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 2,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 4,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 1,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 22,
      "op": "compare",
      "caption": "Is 4 smaller than the best so far, 7?",
      "note": "yes → new best",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        null,
        null,
        "compare",
        null,
        "compare"
      ],
      "markers": [
        {
          "name": "i",
          "index": 2,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 1,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 23,
      "op": "candidate",
      "caption": "4 is the new smallest.",
      "note": null,
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        8,
        7,
        9,
        4
      ],
      "focus": [
        null,
        null,
        null,
        null,
        null,
        "candidate"
      ],
      "markers": [
        {
          "name": "i",
          "index": 2,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 1,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 24,
      "op": "swap",
      "caption": "Swap the smallest (4) into index 2.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        "swap",
        null,
        null,
        "swap"
      ],
      "markers": [
        {
          "name": "i",
          "index": 2,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 1,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 25,
      "op": "settle",
      "caption": "Index 2 is locked in.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        "settled",
        null,
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 2,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 2,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 26,
      "op": "candidate",
      "caption": "Assume index 3 (7) is the smallest for now.",
      "note": null,
      "codeLine": 2,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        null,
        "candidate",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 3,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 2,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 27,
      "op": "compare",
      "caption": "Is 9 smaller than the best so far, 7?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        null,
        "compare",
        "compare",
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 3,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 4,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 2,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 28,
      "op": "compare",
      "caption": "Is 8 smaller than the best so far, 7?",
      "note": "no",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        null,
        "compare",
        null,
        "compare"
      ],
      "markers": [
        {
          "name": "i",
          "index": 3,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 2,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 29,
      "op": "settle",
      "caption": "7 is already the smallest — it stays.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        null,
        "settled",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 3,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 2,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 30,
      "op": "settle",
      "caption": "Index 3 is locked in.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        null,
        "settled",
        null,
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 3,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 3,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 31,
      "op": "candidate",
      "caption": "Assume index 4 (9) is the smallest for now.",
      "note": null,
      "codeLine": 2,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        null,
        null,
        "candidate",
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 4,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 3,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 32,
      "op": "compare",
      "caption": "Is 8 smaller than the best so far, 9?",
      "note": "yes → new best",
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        null,
        null,
        "compare",
        "compare"
      ],
      "markers": [
        {
          "name": "i",
          "index": 4,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 3,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 33,
      "op": "candidate",
      "caption": "8 is the new smallest.",
      "note": null,
      "codeLine": 4,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        9,
        8
      ],
      "focus": [
        null,
        null,
        null,
        null,
        null,
        "candidate"
      ],
      "markers": [
        {
          "name": "i",
          "index": 4,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 3,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 34,
      "op": "swap",
      "caption": "Swap the smallest (8) into index 4.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        8,
        9
      ],
      "focus": [
        null,
        null,
        null,
        null,
        "swap",
        "swap"
      ],
      "markers": [
        {
          "name": "i",
          "index": 4,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 3,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 35,
      "op": "settle",
      "caption": "Index 4 is locked in.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        8,
        9
      ],
      "focus": [
        null,
        null,
        null,
        null,
        "settled",
        null
      ],
      "markers": [
        {
          "name": "i",
          "index": 4,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 4,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 36,
      "op": "candidate",
      "caption": "Assume index 5 (9) is the smallest for now.",
      "note": null,
      "codeLine": 2,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        8,
        9
      ],
      "focus": [
        null,
        null,
        null,
        null,
        null,
        "candidate"
      ],
      "markers": [
        {
          "name": "i",
          "index": 5,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 4,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 37,
      "op": "settle",
      "caption": "9 is already the smallest — it stays.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        8,
        9
      ],
      "focus": [
        null,
        null,
        null,
        null,
        null,
        "settled"
      ],
      "markers": [
        {
          "name": "i",
          "index": 5,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 4,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 38,
      "op": "settle",
      "caption": "Index 5 is locked in.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        8,
        9
      ],
      "focus": [
        null,
        null,
        null,
        null,
        null,
        "settled"
      ],
      "markers": [
        {
          "name": "i",
          "index": 5,
          "tone": "bound"
        },
        {
          "name": "j",
          "index": 5,
          "tone": "compare"
        }
      ],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 5,
          "tone": "settled"
        }
      ]
    },
    {
      "i": 39,
      "op": "settle",
      "caption": "Sorted.",
      "note": null,
      "codeLine": 5,
      "stats": null,
      "array": [
        2,
        3,
        4,
        7,
        8,
        9
      ],
      "focus": [
        "settled",
        "settled",
        "settled",
        "settled",
        "settled",
        "settled"
      ],
      "markers": [],
      "regions": [
        {
          "label": "sorted",
          "from": 0,
          "to": 5,
          "tone": "settled"
        }
      ]
    }
  ]
}