-
Notifications
You must be signed in to change notification settings - Fork 53
Partial completed #40
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
base: master
Are you sure you want to change the base?
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 this is partially completed and what you have is pretty good. Take a look at my comments and let me know what questions you have.
| # 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.
👍
| # Time complexity: O(n) | ||
| # Space complexity: O(n) | ||
| def reverse_in_place(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 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.
👍 This works, but what time/space complexity do you think you have? You're dividing by 2 each time...
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.
Thanks for the updates
| # 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.
👍
| # ...("a", 0) s.length = 1, idx = 0 | ||
| # ...("raeb", 2) s.length = 4, idx = 2 | ||
| # ...("butter", 0) => ("rutteb", 1) => ("rettub", 2) ("rettub", 3) => return | ||
| def reverse_in_place_helper(s, index) |
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.
👍 Nice
No description provided.