Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kate N #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Kate N #26

wants to merge 1 commit into from

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.

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.

# note: the nodes should be moved and not just the values in the nodes
# Time Complexity:
# 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