diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index b8eaf0f..376b7f7 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -13,7 +13,7 @@ "state": { "type": "markdown", "state": { - "file": "Algo/Courses/Chapter 6 - Lists (Exercises).md", + "file": "Algo/Courses/Chapter 6 - Lists.md", "mode": "source", "source": false } @@ -85,7 +85,7 @@ "state": { "type": "backlink", "state": { - "file": "Algo/Courses/Chapter 6 - Lists (Exercises).md", + "file": "Algo/Courses/Chapter 6 - Lists.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -102,7 +102,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "Algo/Courses/Chapter 6 - Lists (Exercises).md", + "file": "Algo/Courses/Chapter 6 - Lists.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -125,7 +125,7 @@ "state": { "type": "outline", "state": { - "file": "Algo/Courses/Chapter 6 - Lists (Exercises).md" + "file": "Algo/Courses/Chapter 6 - Lists.md" } } }, @@ -158,9 +158,9 @@ }, "active": "eaf65669cfff2a2c", "lastOpenFiles": [ + "Algo/Courses/Chapter 6 - Lists (Exercises).md", "Algo/Courses/Chapter 6 - Lists.md", "Algo/Courses/Untitled.md", - "Algo/Courses/Chapter 6 - Lists (Exercises).md", "Algo/Séminaire/Exercices seminaire.md", "Prog/Loops.md", "Algo/CM/CM du 04 octobre.md", diff --git a/Algo/Courses/Chapter 6 - Lists (Exercises).md b/Algo/Courses/Chapter 6 - Lists (Exercises).md index 3348764..4e6c385 100644 --- a/Algo/Courses/Chapter 6 - Lists (Exercises).md +++ b/Algo/Courses/Chapter 6 - Lists (Exercises).md @@ -134,10 +134,12 @@ let concatenate_lists lst1 lst2 = ## Exercise 3.1 ```Ocaml -let growing i = - if i = [] then false - else - let rec grow = - let e::t = i in - let test = e in - if e +let rec growing = function + | [] | [_] -> true + | x :: y :: rest -> if x <= y then growing (y :: rest) else false;; +``` + +## Exercise 3.2 +``` +let rec delete x = function + | e::i -> if x == e then \ No newline at end of file