Skip to content

Ports - Kim#25

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

Ports - Kim#25
Kimberly-Fasbender wants to merge 1 commit into
Ada-C11:masterfrom
Kimberly-Fasbender:master

Conversation

@Kimberly-Fasbender

Copy link
Copy Markdown

No description provided.

@ace-n ace-n left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, other than a tiny nit. Nice work! 👍

Comment thread lib/factorial.rb
# Space complexity: O(1) constant - input size does not affect space
def factorial(number)
raise NotImplementedError
if !number

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tiny nit: is it worth adding a similar "guarding if" for number < 0?

Comment thread lib/factorial.rb
# Computes factorial of the input number and returns it
# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n) linear - where n is the input number - 2

@ace-n ace-n Apr 14, 2019

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One more tiny nit: the - 2 is redundant here. 🙂

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