-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Earth - Lina #28
base: master
Are you sure you want to change the base?
Earth - Lina #28
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done Lina, take a look at my comments especially regarding the reverse_inplace method. Let me know what questions you have via Slack.
# Time complexity: O(n) | ||
# Space complexity: O(n) | ||
def factorial(n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
# Time complexity: O(n^2) | ||
# Space complexity: O(n^2) | ||
def reverse(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
lib/recursive-methods.rb
Outdated
# Time complexity: ? | ||
# Space complexity: ? | ||
def reverse_inplace(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think about adjusting the method signature to this.
def reverse_inplace(s, low = 0, high = s.length - 1)
Does this help you see a way to do it in-place.
# Time complexity: O(n) | ||
# Space complexity: O(n) | ||
def bunny(n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
lib/recursive-methods.rb
Outdated
# Time complexity: O(n^2) | ||
# Space complexity: O(n^2) | ||
def nested(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , however can you see a way to do this O(n) in time/space?
lib/recursive-methods.rb
Outdated
# Time complexity: O(n^2) | ||
# Space complexity: O(n^2) | ||
def search(array, value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
lib/recursive-methods.rb
Outdated
# Time complexity: O(n^2) | ||
# Space complexity: O(n^2) | ||
def is_palindrome(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.