Skip to content
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

Merged
merged 4 commits into from
Mar 2, 2020

Conversation

prshnt19
Copy link
Member

@prshnt19 prshnt19 commented Feb 24, 2020

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.

@czgdp1807
Copy link
Member

Please add some regression tests for the fix.

@czgdp1807
Copy link
Member

Are you participating through GSSoC, 2020?

@prshnt19
Copy link
Member Author

How to run tests locally?
Yes, I am participating through GSSoC 2020

@czgdp1807
Copy link
Member

See, #96 for tests.

@codecov
Copy link

codecov bot commented Feb 24, 2020

Codecov Report

Merging #99 into master will increase coverage by 0.165%.
The diff coverage is 100%.

@@              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
Impacted Files Coverage Δ
pydatastructs/linear_data_structures/__init__.py 100% <ø> (ø) ⬆️
.../linear_data_structures/tests/test_linked_lists.py 100% <100%> (ø) ⬆️
...datastructs/linear_data_structures/linked_lists.py 100% <100%> (ø) ⬆️

Impacted file tree graph

@czgdp1807
Copy link
Member

@codezonediitj/gssoc2020 Please ensure that tests written are correct conceptually and no wrong results produced.
Overall it's good to go and will be merged on 2nd March.

6
>>> sll.append(5)
>>> sll.append_left(2)
>>> print(sll)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
>>> print(sll)
>>> str(sll)

Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
>>> print(sll)
>>> str(sll)

@czgdp1807
Copy link
Member

@codezonediitj/gssoc2020 Please ensure that tests written are correct conceptually and no wrong results produced.
Overall it's good to go and will be merged on 2nd March.

@codezonediitj/gssoc2020 Are the tests written correctly? If yes, then please approve the PR.

@prshnt19
Copy link
Member Author

prshnt19 commented Mar 2, 2020

@codezonediitj/gssoc2020 Please ensure that tests written are correct conceptually and no wrong results produced.
Overall it's good to go and will be merged on 2nd March.

Yes, I have tested the result and ensured it is conceptually correct for all the positions in the linked list( start, middle, and end).

@prshnt19 prshnt19 changed the title [WIP] Fixed pointers in DoublyLinkedList [WIP] DoublyLinkedList and SinglyLinkedList Added Mar 2, 2020
@prshnt19 prshnt19 changed the title [WIP] DoublyLinkedList and SinglyLinkedList Added DoublyLinkedList and SinglyLinkedList Added Mar 2, 2020
@czgdp1807 czgdp1807 changed the title DoublyLinkedList and SinglyLinkedList Added DoublyLinkedList Fixed and SinglyLinkedList Added Mar 2, 2020
sll.extract(0)
sll.extract(-1)
sll[-2].data = 0
assert str(sll) == "[2, 4, 1, 0, 9]"
Copy link
Member

Choose a reason for hiding this comment

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

+1

@czgdp1807 czgdp1807 merged commit 19cabb2 into codezonediitj:master Mar 2, 2020
@prshnt19 prshnt19 deleted the issue_#49 branch March 2, 2020 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants