Skip to content

Conversation

@KateAnnNichols
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.

If I can make a suggestion, start with the easier methods, add_first etc and run those tests first and then move to the other methods. It looks like you jumped to things like reverse which are pretty tricky.

It's clear that this was a challenging assignment. I'd like you, if you have time, to schedule time with me or a tutor to look at the CS fun work. I don't want you to get far behind.

# o(1) b/c pointers at head + tail
def add_first(value)
raise NotImplementedError
node = Node.new data

Choose a reason for hiding this comment

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

You're not changing @head at all.

# Space Complexity
# Space Complexity:
# do with + w/o recursion ?
def reverse

Choose a reason for hiding this comment

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

👍

Since you didn't make any external data structures, your space complexity here is O(1), and since you have to traverse the list once, your time complexity is O(n). You can usually guess this by the fact that there is one and only one loop.

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