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/OCaml/qsort800000.ml | |
| parent | 1c9344fa14cc018558ec9ebfbf1215a772960b6e (diff) | |
| download | inpla-eddac153a064648bee2aef6fb733ab6820bb96c3.tar.gz inpla-eddac153a064648bee2aef6fb733ab6820bb96c3.zip | |
v0.8.2
Diffstat (limited to 'comparison/OCaml/qsort800000.ml')
| -rw-r--r-- | comparison/OCaml/qsort800000.ml | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/comparison/OCaml/qsort800000.ml b/comparison/OCaml/qsort800000.ml index 627abd2..7547f45 100644 --- a/comparison/OCaml/qsort800000.ml +++ b/comparison/OCaml/qsort800000.ml @@ -21,10 +21,20 @@ let rec mkRandList n = 0 -> [] | n -> (Random.int 10000)::(mkRandList (n-1)) ;; -let main = qsort (mkRandList 800000) ;; -(* -The following error arises: +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;; + -Stack overflow during evaluation (looping recursion?). +let main = validation(qsort (mkRandList 800000));; + +(* +Fatal error: exception Stack_overflow *) |
