aboutsummaryrefslogtreecommitdiff
path: root/comparison/OCaml/bsort40000.ml
diff options
context:
space:
mode:
Diffstat (limited to 'comparison/OCaml/bsort40000.ml')
-rw-r--r--comparison/OCaml/bsort40000.ml14
1 files changed, 13 insertions, 1 deletions
diff --git a/comparison/OCaml/bsort40000.ml b/comparison/OCaml/bsort40000.ml
index 45744bd..2a06e85 100644
--- a/comparison/OCaml/bsort40000.ml
+++ b/comparison/OCaml/bsort40000.ml
@@ -19,5 +19,17 @@ let rec mkRandList n =
0 -> []
| n -> (Random.int 10000)::(mkRandList (n-1));;
-let main = bsort (mkRandList 40000);;
+
+let rec validation alist =
+ let rec validation_cons x blist =
+ match blist with
+ [] -> true
+ | y::ys -> if x<=y then (validation_cons y ys) else false
+ in
+ match alist with
+ [] -> true
+ | x::xs -> validation_cons x xs;;
+
+
+let main = validation (bsort (mkRandList 40000));;