Skip to content

Tanja Stroble ^Carets^#37

Open
misstonbon wants to merge 1 commit intoAda-C8:masterfrom
misstonbon:master
Open

Tanja Stroble ^Carets^#37
misstonbon wants to merge 1 commit intoAda-C8:masterfrom
misstonbon:master

Conversation

@misstonbon
Copy link

String Manipulation Practice Exercises

Congratulations! You're submitting your assignment.

Comprehension Questions

What is the time and space complexity for each method you implemented? Provide justification.

Question Answer
What is the time complexity of the string_reverse method? Provide justification. O(n) Loop repeats string.length times, more specifically n/2 times.
What is the space complexity of the string_reverse method? Provide justification. Constant, no new vars created.
What is the time complexity of the reverse_words method? Provide justification. O(n), more specifically 2n. Iterating once through string to check fro whitespace, and reversing the word.
What is the space complexity of the reverse_words method? Provide justification. Constant, same as above.
What is the time complexity of the reverse_sentence method? Provide justification. O(n) n complexity defs reused.
What is the space complexity of the reverse_sentence method? Provide justification. Constant, same as above.
What is the time complexity of the palindrome_check method? Provide justification. O(n) , iterating over the entire string. , best case it is constant if false.
What is the space complexity of the palindrome_check method? Provide justification. Constant, same as above .
What is the time complexity of the encode_repeating method? Provide justification. I tried but couldn't successfully test this out.
What is the space complexity of the encode_repeating method? Provide justification.

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.

1 participant