tp7 exo10
This commit is contained in:
parent
4914e4b0b4
commit
f39773d967
14
tp7/exo10.ml
14
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
|
||||
;;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user