Skip to content

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

Merged
merged 1 commit into from
Jan 7, 2016

Conversation

counterleft
Copy link
Contributor

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.

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.
@jtigger jtigger self-assigned this Jan 7, 2016
@jtigger
Copy link
Contributor

jtigger commented Jan 7, 2016

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.

jtigger added a commit that referenced this pull request Jan 7, 2016
@jtigger jtigger merged commit 3460389 into exercism:master Jan 7, 2016
@counterleft
Copy link
Contributor Author

@jtigger Yeah, I wasn't sure exactly where to place it in the progression. I tried to place it relative to where it was in the ruby progression. I didn't even think about using the checklist in #3 as the progression order.

@counterleft counterleft deleted the linked_list_exercise branch January 7, 2016 18:43
head = newHead;
}

return (T) value;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@sit
Copy link
Contributor

sit commented Jan 7, 2016

I don't know what the other tracks look like, but there should be tests for popping and shifting off an empty Deque.

@counterleft
Copy link
Contributor Author

The instructions for the linked-list exercise (https://github.com/exercism/x-common/blob/master/linked-list.md) state the following:

To keep your implementation simple, the tests will not cover error conditions. Specifically: pop or shift will never be called on an empty Deque.

@counterleft
Copy link
Contributor Author

I'll create another PR for with the suggested changes and cc you @sit.

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.

3 participants