Skip to content

Sockets - Shirley#22

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

Sockets - Shirley#22
shirley1chu wants to merge 1 commit intoAda-C11:masterfrom
shirley1chu:master

Conversation

@shirley1chu
Copy link
Copy Markdown

No description provided.

Comment thread lib/factorial.rb
# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n), where n represents the number. The while loop runs n - 1 times, so the time complexity does depend on n.
# Space complexity: Constant. Regardless of how big the number is, there are only two variables inside the method.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great explanations!

Comment thread lib/factorial.rb
factorial *= number
number -= 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.

Very clear code, nice job. 👍

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