September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1,8 @@
|
|||
fcn insertionSort(list){
|
||||
sink:=List();
|
||||
foreach x in (list){
|
||||
if(False==(n:=sink.filter1n('>(x)))) sink.append(x); // x>all items in sink
|
||||
else sink.insert(n,x);
|
||||
}
|
||||
sink.close();
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
insertionSort(T(4,65,2,-31,0,99,2,83,782,1)).println();
|
||||
insertionSort("big fjords vex quick waltz nymph".split()).println();
|
||||
Loading…
Add table
Add a link
Reference in a new issue