vault backup: 2023-10-13 14:58:36
This commit is contained in:
parent
e29bce3e13
commit
b79c8ba9a0
9
.obsidian/workspace.json
vendored
9
.obsidian/workspace.json
vendored
@ -31,8 +31,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 1
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
@ -169,10 +168,11 @@
|
||||
"command-palette:Open command palette": false
|
||||
}
|
||||
},
|
||||
"active": "c473a791e2b34194",
|
||||
"active": "eaf65669cfff2a2c",
|
||||
"lastOpenFiles": [
|
||||
"Prog/Loops.md",
|
||||
"Algo/Séminaire/Chapter 1 - CAML basics.md",
|
||||
"Algo/Courses/Chapter 6 - Lists (Exercises).md",
|
||||
"Prog/Loops.md",
|
||||
"Algo/Courses/Chapter 6 - Lists.md",
|
||||
"Algo/Séminaire/Chapter 5 - Recursivity.md",
|
||||
"Algo/Séminaire/Chapter 4 - A bit of imperative.md",
|
||||
@ -201,7 +201,6 @@
|
||||
"COM-ADMR",
|
||||
"Methodologie",
|
||||
"Algo/Séminaire/Introduction.md",
|
||||
"Algo/Séminaire/Chapter 1 - CAML basics.md",
|
||||
"Algo/Séminaire/assets/exception-meme.png",
|
||||
"Algo/Séminaire/assets/filter-meme.png",
|
||||
"Algo/Séminaire/assets/if-meme.png",
|
||||
|
@ -183,4 +183,18 @@ val delete: int -> 'a list -> list = <fun>
|
||||
else if i > length list then
|
||||
failwith "Out of bound"
|
||||
else
|
||||
|
||||
(* Correction *)
|
||||
let insert_nth w i list =
|
||||
if i <= 0 then
|
||||
invalid_arg "negative rank"
|
||||
else
|
||||
let rec insrec i = function
|
||||
[] -> if i > 1 then
|
||||
failwith "out of bound"
|
||||
else
|
||||
x::t
|
||||
| e::E when i = 1 -> x::e::t
|
||||
| e::t -> e::insrec (i - 1) t
|
||||
in insrec i list;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user