tp7 exo6 (enfin fini !!!)

This commit is contained in:
Arkitu 2026-01-15 22:18:42 +01:00
parent 93992f7bb5
commit 82c9c23c05
2 changed files with 21 additions and 0 deletions

View File

@ -6,6 +6,10 @@
(name exo5)
(modules exo5)
)
(library
(name exo6)
(modules exo6)
)
(library
(name exo9)
(modules exo9)

17
tp7/exo6.ml Normal file
View File

@ -0,0 +1,17 @@
let creer_lcp () = [];;
let taille_lcp = List.length;;
let acces_lcp = List.nth;;
let rec inserer_lcp l i x = match l,i with
| l, 0 -> x::l
| x::q, i -> x::inserer_lcp q (i-1) x
| _ -> invalid_arg ""
;;
let rec retirer_lcp l i = match l,i with
| _::q, 0 -> q
| x::q, i -> x::retirer_lcp q (i-1)
| _ -> invalid_arg ""
;;