vault backup: 2023-10-06 16:00:48

This commit is contained in:
2023-10-06 16:00:48 +02:00
parent 9fff9089fa
commit c19e9679c6
3 changed files with 34 additions and 8 deletions

View File

@ -78,6 +78,14 @@ val nth 'a list -> int -> 'a = <fun>
let max_tail = max_value tl in
if hd > max_tail then hd else max_tail
in mv list;;
(* Correction *)
let maximum = function
[] -> invalid_arg "Pas bô"
| e::t ->
(let rec max_rec m = function
[]-> m
|e::t -> max_rec (if e>m then e else m) t in max_rec e t);;
```
## 1.6 - Bonus second