vault backup: 2023-10-06 14:06:29

This commit is contained in:
Louis Gallet 2023-10-06 14:06:29 +02:00
parent 8ff68b2f15
commit 30bfc996c9
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY
2 changed files with 14 additions and 19 deletions

View File

@ -4,16 +4,16 @@
"type": "split",
"children": [
{
"id": "5e5c298d690b2150",
"id": "dad720b6161071b1",
"type": "tabs",
"children": [
{
"id": "325e43e04f9c035d",
"id": "c542bf78ebad15cb",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Algo/Séminaire/Exercices seminaire.md",
"file": "Algo/Courses/Chapter 6 - Lists (Exercises).md",
"mode": "source",
"source": false
}
@ -85,7 +85,7 @@
"state": {
"type": "backlink",
"state": {
"file": "Algo/Séminaire/Exercices seminaire.md",
"file": "Algo/Courses/Chapter 6 - Lists (Exercises).md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -102,7 +102,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "Algo/Séminaire/Exercices seminaire.md",
"file": "Algo/Courses/Chapter 6 - Lists (Exercises).md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
@ -125,7 +125,7 @@
"state": {
"type": "outline",
"state": {
"file": "Algo/Séminaire/Exercices seminaire.md"
"file": "Algo/Courses/Chapter 6 - Lists (Exercises).md"
}
}
},
@ -156,8 +156,9 @@
"command-palette:Open command palette": false
}
},
"active": "325e43e04f9c035d",
"active": "c542bf78ebad15cb",
"lastOpenFiles": [
"Algo/Séminaire/Exercices seminaire.md",
"Prog/Loops.md",
"Algo/CM/CM du 04 octobre.md",
"Prog",
@ -168,7 +169,6 @@
"Methodologie/Le cahier des charges.md",
"Methodologie/Gestion.md",
"Algo/Courses/Chapter 6 - Lists (Exercises).md",
"Algo/Séminaire/Exercices seminaire.md",
"Algo/Séminaire/Chapter 3 - Case analysis.md",
"Algo/Courses",
"Algo/Séminaire/Chapter 5 - Recursivity.md",

View File

@ -54,16 +54,11 @@ let rec nth x n =
## 1.5 - Maximum
```Ocaml
let max l =
if l = [] then
0
else
let maxi = 0
let rec m =
let e::t = l
if e >= maxi then
maxi = e
else
m t
let rec max_value list = match list with
| [] -> failwith "La liste est vide"
| [x] -> x
| hd :: tl ->
let max_tail = max_value tl in
if hd > max_tail then hd else max_tail;;
```