Skip to content

Sockets - Sarah#14

Open
sjscotton wants to merge 1 commit intoAda-C11:masterfrom
sjscotton:master
Open

Sockets - Sarah#14
sjscotton wants to merge 1 commit intoAda-C11:masterfrom
sjscotton:master

Conversation

@sjscotton
Copy link
Copy Markdown

No description provided.

Comment thread lib/fibonacci.rb
# Space complexity: ?
# Time complexity: O(n) where n is the value of the number n, the loop will trigger n times,
# with a constant number of steps each time.
# Space complexity: O(1) constant. No matter how big n gets, the same number of constant sized variables are needed.
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.

Comment thread lib/fibonacci.rb
raise NotImplementedError
num_1 = 1
num_2 = 0
raise ArgumentError if n == nil || n < 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I recommend moving this up to line 12 so you exit before any variables or logic are executed. It is good practice for when you start learning recursion and base cases.

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