tp7 exo6 (enfin fini !!!)
This commit is contained in:
parent
93992f7bb5
commit
82c9c23c05
4
tp7/dune
4
tp7/dune
@ -6,6 +6,10 @@
|
|||||||
(name exo5)
|
(name exo5)
|
||||||
(modules exo5)
|
(modules exo5)
|
||||||
)
|
)
|
||||||
|
(library
|
||||||
|
(name exo6)
|
||||||
|
(modules exo6)
|
||||||
|
)
|
||||||
(library
|
(library
|
||||||
(name exo9)
|
(name exo9)
|
||||||
(modules exo9)
|
(modules exo9)
|
||||||
|
|||||||
17
tp7/exo6.ml
Normal file
17
tp7/exo6.ml
Normal 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 ""
|
||||||
|
;;
|
||||||
Loading…
Reference in New Issue
Block a user