Skip to content

London | 25-SDC-NOV | Jesus del Moral | Sprint 2 | Implement Linked List#136

Open
delmorallopez wants to merge 2 commits intoCodeYourFuture:mainfrom
delmorallopez:complexity-Sprint2
Open

London | 25-SDC-NOV | Jesus del Moral | Sprint 2 | Implement Linked List#136
delmorallopez wants to merge 2 commits intoCodeYourFuture:mainfrom
delmorallopez:complexity-Sprint2

Conversation

@delmorallopez
Copy link

@delmorallopez delmorallopez commented Mar 1, 2026

Implement a linked list in Python

@github-actions

This comment has been minimized.

@delmorallopez delmorallopez added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 1, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 1, 2026
@delmorallopez delmorallopez changed the title London | 25-SDC-NOV | Jesus del Moral | Sprint 2 | Complexity London | 25-SDC-NOV | Jesus del Moral | Sprint 2 | Improve Code with Precomputing Mar 1, 2026
@github-actions

This comment has been minimized.

@delmorallopez delmorallopez changed the title London | 25-SDC-NOV | Jesus del Moral | Sprint 2 | Improve Code with Precomputing London | 25-SDC-NOV | Jesus del Moral | Sprint 2 | Implement Linked List Mar 1, 2026
@github-actions

This comment has been minimized.

@delmorallopez delmorallopez added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 1, 2026
Copy link

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

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

Copy link

Choose a reason for hiding this comment

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

  • Why not also clean up references in this method?

  • Could consider delegating the node removing task to remove() -- less code to maintain.

Copy link
Author

Choose a reason for hiding this comment

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

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

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 2, 2026
@delmorallopez delmorallopez added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 3, 2026
@cjyuan
Copy link

cjyuan commented Mar 3, 2026

All good! Well done.

@cjyuan cjyuan added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants