Commit Graph

14 Commits

Author SHA1 Message Date
Christian Clauss
0e6e5056b3
singly_linked_list.py: psf/black (#2008)
* singly_linked_list.py: psf/black

* updating DIRECTORY.md

* Update singly_linked_list.py

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-05-19 13:54:25 +02:00
Christian Clauss
1c62bd10c1
Precision must be a nonnegative integer (#2013)
* Precision must be a nonnegative integer

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2020-05-19 15:46:20 +05:30
Akash
f9e0dd94d6
added __len__ function (#1812)
* 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>
2020-05-18 18:10:55 +02:00
Christian Clauss
bfcb95b297
Create codespell.yml (#1698)
* fixup! Format Python code with psf/black push

* Create codespell.yml

* fixup! Format Python code with psf/black push
2020-01-18 13:24:33 +01:00
Logan Lieou
d09a805804 Typo? (#1653)
* Typo?

newNod -> newNode

* newNode -> new_node

Co-authored-by: Christian Clauss <cclauss@me.com>
2020-01-14 10:21:02 +01:00
Vikas Kumar
0d3c9d586c Update singly_linked_list.py (#1593)
* Update singly_linked_list.py

printing current.data rather than node address in __repr__ for a more readable print statement

* eval(repr(c)) == c

The output of `__repr__()` _should look like a valid Python expression that could be used to recreate an object with the same value_.

https://docs.python.org/3.4/reference/datamodel.html#object.__repr__

* += --> +
2019-11-26 06:45:28 +01:00
Hanif Ali
4c37eb7d07 Improved on Singly Linked List Programs (#1558)
* Improved Singly Linked List
Added String Representations of Nodes and Linked Lists
Added support for indexing and changing of Node data using indices.

* Added a few comments to Linked Lists

* Reformatted to conform to PEP8

* Added from_sequence.py
Convert a Python List to Linked List comprising of Nodes and return head.

* Added print_reverse.py
Recursive program to print the elements of a Linked List in reverse.

* Change 'is not None' for more Pythonicness
2019-11-10 09:47:04 +01:00
Manu M Bhat
cd10c944d1 Issue #1397 (#1403) 2019-10-19 20:14:37 +02:00
William Zhang
9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
Christian Clauss
47a9ea2b0b
Simplify code by dropping support for legacy Python (#1143)
* Simplify code by dropping support for legacy Python

* sort() --> sorted()
2019-08-19 15:37:49 +02:00
rohan11074
137871bfef feature to add input (#749) 2019-04-07 23:55:32 +08:00
Ashwek Swamy
f89d3a9ec3
Update singly_linked_list.py 2018-11-01 21:25:45 +05:30
Ashwek Swamy
48aa4c4a01
Update singly_linked_list.py 2018-11-01 21:04:05 +05:30
Alex Brown
91fccecb56 snake_case all the things 2018-10-19 17:14:25 -05:00