-
Notifications
You must be signed in to change notification settings - Fork 267
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
DoublyLinkedList Fixed and SinglyLinkedList Added #99
Conversation
Please add some regression tests for the fix. |
Are you participating through GSSoC, 2020? |
How to run tests locally? |
See, #96 for tests. |
Codecov Report
@@ Coverage Diff @@
## master #99 +/- ##
=============================================
+ Coverage 97.273% 97.438% +0.165%
=============================================
Files 32 32
Lines 1797 1913 +116
=============================================
+ Hits 1748 1864 +116
Misses 49 49
|
@codezonediitj/gssoc2020 Please ensure that tests written are correct conceptually and no wrong results produced. |
6 | ||
>>> sll.append(5) | ||
>>> sll.append_left(2) | ||
>>> print(sll) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> print(sll) | |
>>> str(sll) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this for now. I have opened a different issue for this purpose.
>>> sll[0].data = 7.2 | ||
>>> sll.extract(1).data | ||
6 | ||
>>> print(sll) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> print(sll) | |
>>> str(sll) |
@codezonediitj/gssoc2020 Are the tests written correctly? If yes, then please approve the PR. |
Yes, I have tested the result and ensured it is conceptually correct for all the positions in the linked list( start, middle, and end). |
sll.extract(0) | ||
sll.extract(-1) | ||
sll[-2].data = 0 | ||
assert str(sll) == "[2, 4, 1, 0, 9]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
References to other Issues or PRs or Relevant literature
#49
Brief description of what is fixed or changed
All the pointers in the DoublyLinkedList were not updated properly. This could have given error in case of traversal. For symmetry, append is renamed to append_right.
Other comments
The issue is not fixed. Work is still in progress.