|
Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Generate fibonacci sequence. More...
#include <cassert>#include <iostream>Functions | |
| uint64_t | fibonacci (uint64_t n) |
| static void | test () |
| int | main () |
| Main function. More... | |
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)\]
| uint64_t fibonacci | ( | uint64_t | n | ) |
Recursively compute sequences
| n | input |
| int main | ( | void | ) |
|
static |
Function for testing the fibonacci() function with a few test cases and assert statement.
void