vault backup: 2023-10-09 14:52:04
This commit is contained in:
parent
f7f5cc38dd
commit
f1743bfc94
@ -151,3 +151,16 @@ let rec delete x = function
|
|||||||
|
|
||||||
## Exercise 3.3
|
## Exercise 3.3
|
||||||
```Ocaml
|
```Ocaml
|
||||||
|
# let rec length l =
|
||||||
|
if l = [] then 0
|
||||||
|
else
|
||||||
|
let e::t = l in
|
||||||
|
1 +. length t;;
|
||||||
|
|
||||||
|
#let rec insert x i list =
|
||||||
|
if x < 0 then
|
||||||
|
invalid_arg "negative rank"
|
||||||
|
else if i > length list then
|
||||||
|
failwith "Out of bound"
|
||||||
|
else
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user