This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize
for the AI-speak, we are working on rewriting it!
The program’s map: every function and which calls which.
There’s no recorded run of this program yet.
Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.
[1]lines 1–20
# Generated by tools/algo/legacy.py from the corpus: do not edit.# The /compare page's insertion sort on a copy.# Element comparisons are routed through lib/algo/legacy/order.viv; nothing else changes.from algo.legacy.order import lg_gt
# from study/compare/lists/sorting.viv: insertion_sortdefinsertion_sort(a) {
a =copy(a)
for i from1tolen(a) {
v = a[i]
j = i
while j >0andlg_gt(a[j -1], v) {
a[j] = a[j -1]
j -=1
}
a[j] = v
}
return a
}