Skip to content

West Midlands | SDC-25 | Gabriel Deng | Sprint 2 | Implement a linked list in Python #100

Open
gai93003 wants to merge 2 commits intoCodeYourFuture:mainfrom
gai93003:implement_link_list
Open

West Midlands | SDC-25 | Gabriel Deng | Sprint 2 | Implement a linked list in Python #100
gai93003 wants to merge 2 commits intoCodeYourFuture:mainfrom
gai93003:implement_link_list

Conversation

@gai93003
Copy link

@gai93003 gai93003 commented Feb 14, 2026

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

@gai93003 gai93003 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 2 Assigned during Sprint 2 of this module Module-Complexity The name of the module. labels Feb 14, 2026
@@ -0,0 +1,60 @@
class Node:
__slots__ = ("value", "previous", "next")
Copy link

Choose a reason for hiding this comment

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

Good practice.

Comment on lines 34 to 39
if node.previous is None:
# One element
self.head = self.tail = None
else:
self.tail = node.previous
self.tail.next = None
Copy link

Choose a reason for hiding this comment

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

Could also just call remove(node) -- 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.

I have removed the duplicate logic. Thanks.

Comment on lines +59 to +60
node.previous = None
node.next = None No newline at end of file
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 pop_tail()?

Copy link
Author

Choose a reason for hiding this comment

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

Done thank you.

@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 Feb 27, 2026
@cjyuan
Copy link

cjyuan commented Feb 27, 2026

Change label?

@gai93003
Copy link
Author

Change label?

I can change the label if you think the solution looks good enough😊

@cjyuan
Copy link

cjyuan commented Feb 27, 2026

Can you look up how labels are used in the CodeYourFuture review flow? I expect it is the same as ITP.

@gai93003
Copy link
Author

I think I have added all the labels except the complete label. I am not sure If I missed something

@cjyuan
Copy link

cjyuan commented Feb 27, 2026

@gai93003
Copy link
Author

Oh yeah, I get it now. Thanks. I will add the needs review label

@gai93003 gai93003 added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Feb 28, 2026
@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. labels Feb 28, 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. Module-Complexity The name of the module. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants