-
Notifications
You must be signed in to change notification settings - Fork 48
Leaves - Julia K #22
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?
Leaves - Julia K #22
Conversation
…ests. Checked path relatives.
… Still only passing three tests in Ruby.
… sentence (Yoda => adoY) but I can't figure out how to un-reverse words post transformation.
CheezItMan
left a comment
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 good start. You're definitely not finished with reverse sentence however. Take a look at my comments and let me know if this helps.
| def reverse_sentence(my_sentence) | ||
| raise NotImplementedError | ||
|
|
||
| def reverse_sentence(test_string) |
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.
Right now you're only reversing the sentence. You then need to do another loop reversing each word. Something to work on.
| # Time complexity: ? | ||
| # Space complexity: ? |
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 & space complexity?
| # Time complexity: ? | ||
| # Space complexity: ? | ||
| # Time complexity: This is an insertion sort with two loops, so time complexity is O(n^2) / quadratic | ||
| # Space complexity: O(1) / constant |
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.
Technically here since you're doing .split you're making a new array of words. So this is O(n)
Sorting & Reverse Sentence