Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
AmirReza-alt wants to merge 4 commits into trekhleb:master
base: master
Choose a base branch
Loading
from AmirReza-alt:LinkedList_methods

Conversation

@AmirReza-alt
Copy link

@AmirReza-alt AmirReza-alt commented Aug 4, 2025

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

Reviewers

2 more reviewers

@andrzejsydor andrzejsydor andrzejsydor approved these changes

@anandfresh anandfresh anandfresh approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /