Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,13 @@
|
|||
fcn combSort(list){
|
||||
len,gap,swaps:=list.len(),len,True;
|
||||
while(gap>1 or swaps){
|
||||
gap,swaps=(1).max(gap.toFloat()/1.2473), False;
|
||||
foreach i in (len - gap){
|
||||
if(list[i]>list[i + gap]){
|
||||
list.swap(i,i + gap);
|
||||
swaps=True;
|
||||
}
|
||||
}
|
||||
}
|
||||
list
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
combSort(List(28, 44, 46, 24, 19, 2, 17, 11, 25, 4)).println();
|
||||
combSort("This is a test".toData()).text.println();
|
||||
Loading…
Add table
Add a link
Reference in a new issue