Skip to content

Sockets - Tatiana#29

Open
tatsqui wants to merge 3 commits intoAda-C11:masterfrom
tatsqui:master
Open

Sockets - Tatiana#29
tatsqui wants to merge 3 commits intoAda-C11:masterfrom
tatsqui:master

Conversation

@tatsqui
Copy link
Copy Markdown

@tatsqui tatsqui commented Apr 22, 2019

Iterative and Recursive solution. Working on memoized solution.

tatsqui and others added 3 commits April 21, 2019 21:45
Comment thread lib/fibonacci.rb
# 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.
Copy link
Copy Markdown

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!

Comment thread lib/fibonacci.rb
# base case
return n if n < 2

return fibonacci(n-1) + fibonacci(n-2)
Copy link
Copy Markdown

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