Skip to content

Conversation

@annamm77
Copy link

No description provided.

end

size
end

Choose a reason for hiding this comment

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

This looks great and works, but in both of these (include?, size) you had to account for that last node separately -- if you change your loop to while current != nil instead of while current.next_node != nil then you wouldn't need that! 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. Hopefully that makes sense!

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