Skip to content

Instantly share code, notes, and snippets.

@tabakerov
Created November 2, 2016 09:34
Show Gist options
  • Save tabakerov/d348e5f8102dc2b123c745af09d6cf1e to your computer and use it in GitHub Desktop.
Save tabakerov/d348e5f8102dc2b123c745af09d6cf1e to your computer and use it in GitHub Desktop.
Recursive Fibbonacci F#
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