diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 376b7f7..29a9043 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -18,8 +18,21 @@ "source": false } } + }, + { + "id": "26919eaeae9a8f38", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Algo/Courses/Chapter 6 - Lists (Exercises).md", + "mode": "source", + "source": false + } + } } - ] + ], + "currentTab": 1 } ], "direction": "vertical" @@ -85,7 +98,7 @@ "state": { "type": "backlink", "state": { - "file": "Algo/Courses/Chapter 6 - Lists.md", + "file": "Algo/Courses/Chapter 6 - Lists (Exercises).md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -102,7 +115,7 @@ "state": { "type": "outgoing-link", "state": { - "file": "Algo/Courses/Chapter 6 - Lists.md", + "file": "Algo/Courses/Chapter 6 - Lists (Exercises).md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -125,7 +138,7 @@ "state": { "type": "outline", "state": { - "file": "Algo/Courses/Chapter 6 - Lists.md" + "file": "Algo/Courses/Chapter 6 - Lists (Exercises).md" } } }, @@ -156,10 +169,10 @@ "command-palette:Open command palette": false } }, - "active": "eaf65669cfff2a2c", + "active": "26919eaeae9a8f38", "lastOpenFiles": [ - "Algo/Courses/Chapter 6 - Lists (Exercises).md", "Algo/Courses/Chapter 6 - Lists.md", + "Algo/Courses/Chapter 6 - Lists (Exercises).md", "Algo/Courses/Untitled.md", "Algo/Séminaire/Exercices seminaire.md", "Prog/Loops.md", diff --git a/Algo/Courses/Chapter 6 - Lists (Exercises).md b/Algo/Courses/Chapter 6 - Lists (Exercises).md index 4e6c385..cf4415c 100644 --- a/Algo/Courses/Chapter 6 - Lists (Exercises).md +++ b/Algo/Courses/Chapter 6 - Lists (Exercises).md @@ -140,6 +140,12 @@ let rec growing = function ``` ## Exercise 3.2 -``` +```Ocaml let rec delete x = function - | e::i -> if x == e then \ No newline at end of file + | [] -> [] + | e::i -> + if x == e then i + else if e < x then + e::delete x i + else 1 +```