Skip to content

Conversation

@jweeber
Copy link

@jweeber jweeber commented May 26, 2016

Completed include, size, and max methods. Interesting with testing - you have to break the while current.next_node != nil pattern here to make sure the last node gets looked at for each of these, otherwise they don't work. I made some more tests at the end.

@sudocrystal
Copy link

This looks great! I also love that you added more tests!

current = current.next_node
end
return maximum
end

Choose a reason for hiding this comment

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

I LOVE that you recognized that you could change your loop to while current != nil instead of while current.next_node != nil ! I told you to model after display which does it the latter way -- because sometimes you need to do something different with the last case and I wanted that to be the pattern I showed -- but now I want to point out how we could have optimized the pattern just slightly. Really nice!

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