Skip to content
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

WIP Enhance LinkedList with new methods #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vmasto
Copy link

@vmasto vmasto commented Feb 14, 2017

Hello! This PR aims to add a few more helpful methods in the Linked List implementation. If you so approve we could add more and once the API is finalized I'd be happy to implement a Doubly Linked List.

I'm aware of issue #18 but I'd need a few more details on what methods you'd like to be added.

Adds #find, #findLast, #addBefore, #addAfter
@Yomguithereal
Copy link
Owner

Hello @vmasto. Thanks for the PR. I think we need to change some things about the LinkedList before adding the move methods. I think we should make the internal node rely on some class like LinkedListNode instead of a plain object and make the push method return the instance of this class because else the move methods are O(n) rather than O(1) which is normally the real advantage of using a list rather than an array in memory. What do you think?

@vmasto
Copy link
Author

vmasto commented Feb 15, 2017

Makes sense to use LinkedListNode, however can we spec out the move methods?

@Yomguithereal
Copy link
Owner

Sure. Just ping me back if I forget.

@vmasto
Copy link
Author

vmasto commented Feb 16, 2017

Ping :D

@Yomguithereal
Copy link
Owner

I am still reflecting on how to change the API if we go the node class way. Because it might feel strange if some methods return a node and other ones don't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants