Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
bundle Default {
|
||||
class Insert {
|
||||
function : Main(args : String[]) ~ Nil {
|
||||
values := [9, 7, 10, 2, 9, 7, 4, 3, 10, 2, 7, 10];
|
||||
InsertionSort(values);
|
||||
each(i : values) {
|
||||
values[i]->PrintLine();
|
||||
};
|
||||
}
|
||||
|
||||
function : InsertionSort (a : Int[]) ~ Nil {
|
||||
each(i : a) {
|
||||
value := a[i];
|
||||
j := i - 1;
|
||||
while(j >= 0 & a[j] > value) {
|
||||
a[j + 1] := a[j];
|
||||
j -= 1;
|
||||
};
|
||||
a[j + 1] := value;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue