Documentation ¶
Overview ¶
Package fibonacci allows you to calculate which fibonacci number would be at a given index. Imagine the fibonacci sequence is represented in the form of a slice of ints, similar to the below example.
Fibonacci Sequence []int{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233...}
Example ¶
package main import ( "fmt" "github.com/eng618/go-eng/algo/fibonacci" ) func main() { // Fibonacci example fibO := fibonacci.Dynamic() fmt.Println(fibO(10)) // FibonacciBU example fmt.Println(fibonacci.BottomUp(10)) // Fib example fmt.Println(fibonacci.Basic(10)) }
Output: 55 55 55
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.