Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -1,9 +1,10 @@
|
|||
fun merge cmp ([], ys) = ys
|
||||
| merge cmp (xs, []) = xs
|
||||
| merge cmp (xs as x::xs', ys as y::ys') =
|
||||
case cmp (x, y) of GREATER => y :: merge cmp (xs, ys')
|
||||
| _ => x :: merge cmp (xs', ys)
|
||||
;
|
||||
case cmp (x, y) of
|
||||
GREATER => y :: merge cmp (xs, ys')
|
||||
| _ => x :: merge cmp (xs', ys)
|
||||
|
||||
fun merge_sort cmp [] = []
|
||||
| merge_sort cmp [x] = [x]
|
||||
| merge_sort cmp xs = let
|
||||
|
|
@ -12,5 +13,3 @@ fun merge_sort cmp [] = []
|
|||
in
|
||||
merge cmp (merge_sort cmp ys, merge_sort cmp zs)
|
||||
end
|
||||
;
|
||||
merge_sort Int.compare [8,6,4,2,1,3,5,7,9]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue