Skip to content

Linked list methods #2066

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AmirReza-alt
Copy link

Add some usefull methods to LinkedList data structure.

List usually have some methods and properties that let user to give some information from the list like length.
I add some of this methods to the class to make it better.
This is a list of what methods i add:

  • indexOf()
    to find a index by it's value.

  • at()
    to find a value by it's index.

  • print()
    to print the entire list. example : 30 ==> 40 ==> 50 ==> null

  • getSize()
    to get the length of the linked list.
    its better to define the property for this one but i prefere to don't touch the entire code and i just make a method for this one.

I hope it helps. This is my first contribution. If it's not a problem for you please tell me my mistakes to make myself better.😊

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.

1 participant