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

Ports - Sopheary #33

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Ports - Sopheary #33

wants to merge 6 commits into from

Conversation

sophearychiv
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! You hit the learning goals here, and did very well with the Big-O questions. Nice work. Take a look at my comments and let me know any questions you have.

def search(value)
raise NotImplementedError
return false if @head.nil?
return true if @head.data = value

Choose a reason for hiding this comment

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

Is this needed? Wouldn't the loop catch this as well?

return nil if @head.nil?
current = @head
index = 0
until current.nil?

Choose a reason for hiding this comment

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

What if n is larger than the length of the list?

def has_cycle
raise NotImplementedError
return nil if @head.nil?

Choose a reason for hiding this comment

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

👍

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