-
Notifications
You must be signed in to change notification settings - Fork 47
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
base: master
Are you sure you want to change the base?
Ports - Sopheary #33
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
No description provided.