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

Sockets - Tatiana #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Sockets - Tatiana #29

wants to merge 3 commits into from

Conversation

tatsqui
Copy link

@tatsqui tatsqui commented Apr 22, 2019

Iterative and Recursive solution. Working on memoized solution.

# the fibonacci tree function calls base case for each branch of the tree (n-1) & (n-2),
# which grows exponentially for each subsequently higher level of the binary tree.
# Space complexity: I am not sure, but I think that it lineary because of the call stack
# required for each branch of the binary tree.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice explanations on both the iterative and recursive solutions!

# base case
return n if n < 2

return fibonacci(n-1) + fibonacci(n-2)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are both great solutions and very clear to read. Good work! 👍

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

Successfully merging this pull request may close these issues.

2 participants