Sorting algorithms/Insertion sort: Difference between revisions

Added 11l
(Added 11l)
Line 30:
Writing the algorithm for integers will suffice.
<br><br>
 
=={{header|11l}}==
{{trans|Python}}
 
<lang 11l>F insertion_sort(&l)
L(i) 1 .< l.len
V j = i - 1
V key = l[i]
L j >= 0 & l[j] > key
l[j + 1] = l[j]
j--
l[j + 1] = key
 
V arr = [7, 6, 5, 9, 8, 4, 3, 1, 2, 0]
insertion_sort(&arr)
print(arr)</lang>
 
{{out}}
<pre>
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
</pre>
 
=={{header|360 Assembly}}==
Line 154 ⟶ 175:
{{out}}
Same as previous
 
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
1,481

edits