vault backup: 2023-09-15 15:47:24
This commit is contained in:
@ -115,3 +115,17 @@ Exemple with egypt (4.10) vs multiply (4.6):
|
||||
| b -> a +mult (b-1)
|
||||
in mult b;;
|
||||
```
|
||||
|
||||
The best algorithm in term of complexity is the parameter that is constant/linear or logarithmic. If you have an exponential algorithm, you can put it in trash :)
|
||||
|
||||
**Exemple with fibonacci algorithm**
|
||||
|
||||
| |res|how (for human) ?|How (for function) ?|
|
||||
|:----:|:----:|:----:|:----:|
|
||||
|0|1|def|1 call|
|
||||
|1|1|def|1 call|
|
||||
|2|2|+|3 calls|
|
||||
|3|3|+|5 calls|
|
||||
|4|5|+|7 calls|
|
||||
|5|8|+|9 calls|
|
||||
|6|13|+|11 calls|
|
||||
|
Reference in New Issue
Block a user