Skip to content

Instantly share code, notes, and snippets.

@ryanseys
Created January 20, 2013 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanseys/4580699 to your computer and use it in GitHub Desktop.
Save ryanseys/4580699 to your computer and use it in GitHub Desktop.
Recursive Fibonacci solution
def fib_r(n)
if(n <= 1)
return 1
else
return fib(n-1) + fib(n-2)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment