|
Algorithms_in_C++
1.0.0
Set of algorithms implemented in C++.
|
Generate fibonacci sequence. More...
#include <cassert>#include <iostream>Functions | |
| unsigned int | fibonacci (unsigned int n) |
| static void | test () |
| int | main () |
| Main function. | |
Generate fibonacci sequence.
Calculate the the value on Fibonacci's sequence given an integer as input.
\[\text{fib}(n) = \text{fib}(n-1) + \text{fib}(n-2)\]
| unsigned int fibonacci | ( | unsigned int | n | ) |
|
static |
Function for testing the fibonacci() function with a few test cases and assert statement.
void