Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fibonacci Series in Dynamic Programming #117

Open
FredWe opened this issue Feb 6, 2017 · 0 comments
Open

Fibonacci Series in Dynamic Programming #117

FredWe opened this issue Feb 6, 2017 · 0 comments

Comments

@FredWe
Copy link
Owner

FredWe commented Feb 6, 2017

Question: fibonacci series function. i.e. fib(1) = 1, fib(2) = 1, fib(3) = 2 ...

Recursive solution is intuitive:

def fib(n):
  if n == 1 or n == 2:
    return 1
  else:
    return fib(n - 1) + fib(n - 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant