Created
November 2, 2016 09:34
-
-
Save tabakerov/d348e5f8102dc2b123c745af09d6cf1e to your computer and use it in GitHub Desktop.
Recursive Fibbonacci F#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rec fib_a p = | |
if (p = 0) || (p = 1) | |
then 1 | |
else | |
fib_a(p-1)+fib_a(p-2) | |
let rec fib_b p = | |
match p with | |
| 1 | 0 -> 1 | |
| n -> fib_b(n-1)+fib_b(n-2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment