8000 added __len__ function · Pull Request #1812 · TheAlgorithms/Python · GitHub
[go: up one dir, main page]

Skip to content

added __len__ function #1812

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 3 commits into from May 18, 2020
Merged

added __len__ function #1812

merged 3 commits into from May 18, 2020

Conversation

ghost
Copy link
@ghost ghost commented Mar 25, 2020

Added a function to count number of nodes in linked list

Added a function to count number of nodes in linked list

def __len__(self):
"""Return length of linked list i.e. number of nodes """
curNode = self.head
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python naming uses snake_case so cur_node

@stale
Copy link
stale bot commented May 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Used to mark an issue or pull request stale. label May 2, 2020
used snake_case instead of camel case
@stale stale bot removed the stale Used to mark an issue or pull request stale. label May 2, 2020
@cclauss cclauss merged commit f9e0dd9 into TheAlgorithms:master May 18, 2020
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* added __len__ function

Added a function to count number of nodes in linked list

* Updated __len__ method

used snake_case instead of camel case

* Add tests to __len__()

Co-authored-by: Christian Clauss <cclauss@me.com>
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
0