0
how can I write the code for the fibonacin and how long the execution takes place
2 Antworten
0
how write code plz
- 1
Do you mean Fibonacci numbers? If so, the following algorithm can find it.
First two numbers are 1
Repeat the following until you have however many you want
The next number is equal to the sum of the last two
1: 1
2: 1
3: sum of 1 & 2 or 2
4: sum of 2 & 3 or 3
5: sum of 3 & 4 or 5
6: sum of 4 & 5 or 8