-
-
Notifications
You must be signed in to change notification settings - Fork 710
Add linked-list exercise #85
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
Conversation
The tests assume that the Deque class is implemented with generics. The example implementation keeps track of a circular head Element. Completes one task in exercism#3.
Thank you! Looks really good, @winterchord. Thanks for following suit and using AssertJ! Also, this is a great exercise to introduce generics; nice touch. I'm not sure how strict we want to be with the progression. This should definitely be later in the track as you've placed it. I do notice that in the check list (#3), it's after Pascal's Triangle. |
head = newHead; | ||
} | ||
|
||
return (T) 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.
Element
should be generic as well and instead of storing an Object
should store an object of type T
. Then this cast becomes unnecessary.
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.
You're absolutely right. I had that in a previous implementation. Don't know why I got rid of it.
I don't know what the other tracks look like, but there should be tests for popping and shifting off an empty |
The instructions for the linked-list exercise (https://github.com/exercism/x-common/blob/master/linked-list.md) state the following:
|
I'll create another PR for with the suggested changes and cc you @sit. |
The tests assume that the Deque class is implemented with generics.
The example implementation keeps track of a circular head Element.
Completes one task in #3.