Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,14 @@
import List;
public list[int] insertionSort(a){
for(i <- [0..size(a)-1]){
v = a[i];
j = i-1;
while(j >= 0 && a[j] > v){
a[j+1] = a[j];
j -= 1;
}
a[j+1] = v;
}
return a;
}

View file

@ -0,0 +1,2 @@
rascal>rascal>insertionSort([4, 65, 2, -31, 0, 99, 83, 782, 1])
list[int]: [-31,0,1,2,4,65,83,99,782]