diff options
| author | Shinya Sato <shinnya.sato@gmail.com> | 2022-04-28 21:41:58 +0900 |
|---|---|---|
| committer | Shinya Sato <shinnya.sato@gmail.com> | 2022-04-28 21:41:58 +0900 |
| commit | eddac153a064648bee2aef6fb733ab6820bb96c3 (patch) | |
| tree | c12f212dc501e6053ec034d1a9f4734b8b94b4d2 /comparison/SML/msort-800000.sml | |
| parent | 1c9344fa14cc018558ec9ebfbf1215a772960b6e (diff) | |
| download | inpla-eddac153a064648bee2aef6fb733ab6820bb96c3.tar.gz inpla-eddac153a064648bee2aef6fb733ab6820bb96c3.zip | |
v0.8.2
Diffstat (limited to 'comparison/SML/msort-800000.sml')
| -rw-r--r-- | comparison/SML/msort-800000.sml | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/comparison/SML/msort-800000.sml b/comparison/SML/msort-800000.sml index 9209685..4ed65ea 100644 --- a/comparison/SML/msort-800000.sml +++ b/comparison/SML/msort-800000.sml @@ -28,7 +28,7 @@ fun msort [] = [] end; -(* mkRandList *) +(* Creates a random list *) local val nextInt = Random.randRange(1,10000); val r = Random.rand(1,1); @@ -38,5 +38,18 @@ in end; +(* Validation checks *) +fun validation [] = true + | validation (x::xs) = + let fun validation_cons x [] = true + | validation_cons x (y::ys) = + if x<=y then validation_cons y ys + else false + in + validation_cons x xs + end; + + +(* Main *) msort (mkRandList 800000); |
