vault backup: 2023-10-20 15:33:32
This commit is contained in:
@ -282,6 +282,20 @@ Complexity : $O(\sum_{\forall{l\in{(el::ll)}}}^{}1+length(l))$
|
||||
## Exercise 6.1
|
||||
```Ocaml
|
||||
let rec decompose x =
|
||||
if ()
|
||||
if (x % 2) = 0 then
|
||||
if x = 1 then
|
||||
return x
|
||||
else if x % 2 == 0 then
|
||||
decompose(x/2)
|
||||
else if x%3 = 0 then
|
||||
decompose(x/3)
|
||||
else if x%5 = 0 then
|
||||
decompose(x/5)
|
||||
else if x%7 = 0 then
|
||||
decompose(x/7)
|
||||
else if x%9 = 0 then
|
||||
decompose(x/9)
|
||||
else if x%11 = 0 then
|
||||
decompose(x/11)
|
||||
else if x%13 = 0 then
|
||||
decompose(x/13)
|
||||
else return x
|
||||
|
Reference in New Issue
Block a user