Skip to content

Conversation

@raisahv
Copy link

@raisahv raisahv commented Sep 16, 2019

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! Your methods both work. See my note on time complexity for delete_at.

Excellent job!


# Time Complexity: ?
# Space Complexity: ?
# Time Complexity: The time complexity is O(n) because the algorithms time varies linearly with the length of the list array.

Choose a reason for hiding this comment

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

Actually the time complexity is O(n2) because the delete_at method takes O(n) time. This is because it has to shift all elements to the left one index.


# Time Complexity: ?
# Space Complexity: ?
# Time Complexity: The time complexity is O(nm) because in the worst case scenario the time that the algorithm takes can change linearly based on the length of the first string in the array passed AND the length of the array itself.

Choose a reason for hiding this comment

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

Perfect! Well done!

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