Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,11 @@
let rec bsort s =
let rec _bsort = function
| x :: x2 :: xs when x > x2 ->
x2 :: _bsort (x :: xs)
| x :: x2 :: xs ->
x :: _bsort (x2 :: xs)
| s -> s
in
let t = _bsort s in
if t = s then t
else bsort t

View file

@ -0,0 +1,17 @@
let rec bsort s =
let rec _bsort = function
| x :: x2 :: xs when x > x2 -> begin
match _bsort (x :: xs) with
| None -> Some (x2 :: x :: xs)
| Some xs2 -> Some (x2 :: xs2)
end
| x :: x2 :: xs -> begin
match _bsort (x2 :: xs) with
| None -> None
| Some xs2 -> Some (x :: xs2)
end
| _ -> None
in
match _bsort s with
| None -> s
| Some s2 -> bsort s2