mp2i-info/tp4/bin/exo4.ml
2025-11-07 11:51:11 +01:00

7 lines
171 B
OCaml

let rec is_ordered l = match l with
| a::b::q -> a <= b && is_ordered (b::q)
| _ -> true;;
assert (is_ordered [1; 5; 6]);;
assert (not (is_ordered [5.6; 7.8; 3.]));;