diff --git a/Algo/Séminaire/Chapter 5 - Recursivity.md b/Algo/Séminaire/Chapter 5 - Recursivity.md index 262df8d..969c3e1 100644 --- a/Algo/Séminaire/Chapter 5 - Recursivity.md +++ b/Algo/Séminaire/Chapter 5 - Recursivity.md @@ -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) \ No newline at end of file +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;; +```