-
Notifications
You must be signed in to change notification settings - Fork 45
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
Laura | Nodes #33
base: master
Are you sure you want to change the base?
Laura | Nodes #33
Conversation
i = 0 | ||
s = 0 | ||
e = 0 | ||
|
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.
Minor: your indentation seems a little off.
@@ -1,4 +1,46 @@ | |||
# A method to reverse the words in a sentence, in place. | |||
# A method to reverse the my_sentences in a sentence, in place. | |||
# Time: O(n^2) |
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.
The time complexity of your algorithm is actually O(n). Take a read on an explanation on: https://github.com/Ada-C10/reverse_sentence/blob/solution/lib/reverse_sentence.rb
I'd also encourage you to elaborate your time and space complexity reasoning. Often, being able to explain your logic and reasoning is more important than getting the correct final answer.
Looks good! See comments inline about time and space complexity. |
Time and Space complexity in comments of my code