London | 25-SDC-NOV | Jesus del Moral | Sprint 2 | Implement Linked List#136
Open
delmorallopez wants to merge 2 commits intoCodeYourFuture:mainfrom
Open
London | 25-SDC-NOV | Jesus del Moral | Sprint 2 | Implement Linked List#136delmorallopez wants to merge 2 commits intoCodeYourFuture:mainfrom
delmorallopez wants to merge 2 commits intoCodeYourFuture:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
e6ca811 to
58edea4
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
58edea4 to
22e3f54
Compare
cjyuan
reviewed
Mar 2, 2026
cjyuan
left a comment
There was a problem hiding this comment.
The PR description is not quite accurate.
Comment on lines
+48
to
+56
|
|
||
| if old_tail.previous: | ||
| self.tail = old_tail.previous | ||
| self.tail.next = None | ||
| else: | ||
| # Only one element | ||
| self.head = None | ||
| self.tail = None | ||
|
|
There was a problem hiding this comment.
-
Why not also clean up references in this method?
-
Could consider delegating the node removing task to
remove()-- less code to maintain.
Author
There was a problem hiding this comment.
Delegating to remove() would definitely reduce duplication and keep the logic in one place. It would make the implementation cleaner and easier to maintain, since any changes to the removal logic would only need to be made in a single method.
Delegating to remove(old_tail) does include the cleanup references because remove() method already does this
|
All good! Well done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement a linked list in Python