Skip to content

Sockets - Jansen#20

Open
JansenMartin wants to merge 1 commit into
Ada-C11:masterfrom
JansenMartin:master
Open

Sockets - Jansen#20
JansenMartin wants to merge 1 commit into
Ada-C11:masterfrom
JansenMartin:master

Conversation

@JansenMartin
Copy link
Copy Markdown

No description provided.

Comment thread lib/factorial.rb
# Time complexity: ?
# Space complexity: ?
# Time complexity: Linear or O(n), where n stands for input. However many times the loop runs depends on input.
# Space complexity: Constant 1(n), where n stands for input. Additional space doesn't rely on input.
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 thought it was written as O(1)?

Comment thread lib/factorial.rb
i += 1
end

return factorial
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 work!

Comment thread lib/factorial.rb
raise NotImplementedError
raise ArgumentError if number == nil

i = 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.

Interesting approach. i = 2 feels like 2 should be a well named constant, since right now there's no indication of why it is set to two.

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