From f39773d9678f6c4ff2eb764ddde59e3cd9ca1419 Mon Sep 17 00:00:00 2001 From: Arkitu Date: Thu, 15 Jan 2026 21:29:24 +0100 Subject: [PATCH] tp7 exo10 --- tp7/exo10.ml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tp7/exo10.ml b/tp7/exo10.ml index 4167b95..7222dd1 100644 --- a/tp7/exo10.ml +++ b/tp7/exo10.ml @@ -1,2 +1,14 @@ let creer_file () = [],[];; -let enfiler_file (t,q) x = t, x::q;; + +let enfiler_file (t,q) x = (t, x::q);; + +let rec defiler_file = function + | [], [] -> failwith "Empty queue" + | x::tq, q -> x, (tq, q) + | [], q -> defiler_file (List.rev q, []) +;; + +let est_vide_file = function + | [], [] -> true + | _ -> false +;;