Skip to content

Conversation

@maria-im015
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +34 to 36
# Time Complexity: O(n)
# Space Complexity: O(1)
def search(self, value):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +45 to 47
# Time Complexity: O(n)
# Space Complexity: O(1)
def length(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +59 to 61
# Time Complexity: O(n)
# Space Complexity: O(1)
def get_at_index(self, index):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 74 to 76
# Time Complexity: ?
# Space Complexity: ?
def get_last(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Time/space complexity?

Comment on lines +116 to 118
# Time Complexity: O(n)
# Space Complexity: O(1)
def delete(self, value):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , 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):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 , 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):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines 167 to 169
# Time Complexity: ?
# Space Complexity: ?
def find_middle_value(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good reuse of existing methods

Comment on lines 176 to 178
# Time Complexity: ?
# Space Complexity: ?
def find_nth_from_end(self, n):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good use of arithmetic and length, but what about the time/space complexity?

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.

2 participants