vault backup: 2023-09-15 14:56:59
This commit is contained in:
parent
c297a59106
commit
45f01665d9
@ -104,4 +104,14 @@ An accumulator is a thing that try to get our result. In CAML we trying to not u
|
||||
```
|
||||
|
||||
## 4.3. Complexity
|
||||
Exemple with egypt (4.10) vs multiply (4.6)
|
||||
Exemple with egypt (4.10) vs multiply (4.6):
|
||||
```Ocaml
|
||||
# let multiplu a b =
|
||||
let (a,b) = if a > b then
|
||||
(a,b) else
|
||||
(b,a)
|
||||
in let rec mult = function
|
||||
| 0 -> 0
|
||||
| b -> a +mult (b-1)
|
||||
in mult b;;
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user