Run to execute this JavaScript code for real (output appears here).
Ready.
Builds a sorted prefix one element at a time: the next element (the key) is lifted out, larger elements of the prefix shift one step right, and the key drops into the gap. Press Run (Ctrl + Enter) to animate, or Step forward (F10) to go one event at a time.
Step
1 / 43
Line (JavaScript)
—
main (no active function frames)
No counted operations yet.
[12, 11, 13, 5, 6]