Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,19 @@
|
|||
function : Swap(p : Int[]) ~ Nil {
|
||||
t := p[0];
|
||||
p[0] := p[1];
|
||||
p[1] := t;
|
||||
}
|
||||
|
||||
function : Sort(a : Int[]) ~ Nil {
|
||||
do {
|
||||
sorted := true;
|
||||
size -= 1;
|
||||
for (i:=0; i<a->Size(); i+=1;) {
|
||||
if (a[i+1] < a[i]) {
|
||||
swap(a+i);
|
||||
sorted := 0;
|
||||
};
|
||||
};
|
||||
}
|
||||
while (sorted = false);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue