Update
This commit is contained in:
parent
e267fff78e
commit
e105277181
14 changed files with 60 additions and 14 deletions
|
@ -15,7 +15,7 @@ But if we tackle a problem such as computing *N*th [Fibonacci number](fibonacci_
|
|||
```
|
||||
int fib(int n)
|
||||
{
|
||||
return (n == 0 || n == 1) ?
|
||||
return (n < 2) ?
|
||||
n : // start the sequence with 0, 1
|
||||
fib(n - 1) + fib(n - 2); // else add two previous
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue