all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,15 @@
declare
fun {MergeSort Xs}
case Xs
of nil then nil
[] [X] then [X]
else
Middle = {Length Xs} div 2
Left Right
{List.takeDrop Xs Middle ?Left ?Right}
in
{List.merge {MergeSort Left} {MergeSort Right} Value.'<'}
end
end
in
{Show {MergeSort [3 1 4 1 5 9 2 6 5]}}