diff options
| author | Shinya Sato <shinnya.sato@gmail.com> | 2022-04-28 21:47:28 +0900 |
|---|---|---|
| committer | Shinya Sato <shinnya.sato@gmail.com> | 2022-04-28 21:47:28 +0900 |
| commit | 7ea48cd96551247ecc763a5e42404ffa3464d0b0 (patch) | |
| tree | fd1b63ab48d98a9243d3053522e17e31b9dc033f /comparison/SML/bsort-40000.sml | |
| parent | 950e2cb2184cb7ead93ba8df691a190598ed242f (diff) | |
| parent | 429543c748aaf81b2a4207318eb5a05259469b21 (diff) | |
| download | inpla-7ea48cd96551247ecc763a5e42404ffa3464d0b0.tar.gz inpla-7ea48cd96551247ecc763a5e42404ffa3464d0b0.zip | |
Merge branch 'develop'
Diffstat (limited to 'comparison/SML/bsort-40000.sml')
| -rw-r--r-- | comparison/SML/bsort-40000.sml | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/comparison/SML/bsort-40000.sml b/comparison/SML/bsort-40000.sml index e892f09..5e6e98b 100644 --- a/comparison/SML/bsort-40000.sml +++ b/comparison/SML/bsort-40000.sml @@ -15,7 +15,7 @@ fun go xs 0 = xs fun bsort xs = go xs (length(xs) - 1); -(* mkRandList *) +(* Creates a random list *) local val nextInt = Random.randRange(1,10000); val r = Random.rand(1,1); @@ -25,4 +25,17 @@ in end; -bsort (mkRandList 40000); +(* 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 *) +validation(bsort(mkRandList 40000)); |
