Maria M. - Scissors#38
Open
maria-im015 wants to merge 1 commit intoAda-C15:masterfrom
Open
Conversation
CheezItMan
reviewed
Oct 7, 2021
CheezItMan
left a comment
There was a problem hiding this comment.
Nice work Maria, you hit the learning goals here. Well done. I left a few minor comments. Let me know what questions you have.
Comment on lines
+16
to
18
| # Time Complexity: O(1) | ||
| # Space Complexity: O(1) | ||
| def get_first(self): |
Comment on lines
+34
to
36
| # Time Complexity: O(n) | ||
| # Space Complexity: O(1) | ||
| def search(self, value): |
Comment on lines
+45
to
47
| # Time Complexity: O(n) | ||
| # Space Complexity: O(1) | ||
| def length(self): |
Comment on lines
+59
to
61
| # Time Complexity: O(n) | ||
| # Space Complexity: O(1) | ||
| def get_at_index(self, index): |
Comment on lines
74
to
76
| # Time Complexity: ? | ||
| # Space Complexity: ? | ||
| def get_last(self): |
Comment on lines
+116
to
118
| # Time Complexity: O(n) | ||
| # Space Complexity: O(1) | ||
| def delete(self, value): |
There was a problem hiding this comment.
👍 , I do want to point out that this implementation is deleting all instances of value in the list. Not wrong, just an implementation choice.
Comment on lines
+134
to
136
| # Time Complexity: O(n) | ||
| # Space Complexity: O(1) | ||
| def visit(self): |
There was a problem hiding this comment.
👍 , but the space complexity here is O(n) because it builds a list
Comment on lines
+148
to
150
| # Time Complexity: O(n) | ||
| # Space Complexity: O(1) | ||
| def reverse(self): |
Comment on lines
167
to
169
| # Time Complexity: ? | ||
| # Space Complexity: ? | ||
| def find_middle_value(self): |
Comment on lines
176
to
178
| # Time Complexity: ? | ||
| # Space Complexity: ? | ||
| def find_nth_from_end(self, n): |
There was a problem hiding this comment.
👍 Good use of arithmetic and length, but what about the time/space complexity?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.