Skip to content

Glasgow | 25 SDC NOV | Katarzyna Kazimierczuk | Sprint 2 | linked list #117

Open
katarzynakaz wants to merge 6 commits intoCodeYourFuture:mainfrom
katarzynakaz:linked-list
Open

Glasgow | 25 SDC NOV | Katarzyna Kazimierczuk | Sprint 2 | linked list #117
katarzynakaz wants to merge 6 commits intoCodeYourFuture:mainfrom
katarzynakaz:linked-list

Conversation

@katarzynakaz
Copy link
Copy Markdown

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

Changelist

Linked list python task is completed.

@katarzynakaz katarzynakaz added 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 20, 2026
@katarzynakaz katarzynakaz changed the title Glasgow | 25 SDC NOV | Katarzyna Kazimierczuk| Sprint 2 | linked list Glasgow | 25 SDC NOV | Katarzyna Kazimierczuk | Sprint 2 | linked list Feb 20, 2026
Copy link
Copy Markdown

@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.

Your current implementation is not an actual linked list -- it is an emulation of a linked list using Python list (which is an array). Can you implement a real linked list ? (https://en.wikipedia.org/wiki/Linked_list)

Also, can you implement the linked list as a class so that it can pass all the tests in linked_list_test.py?

@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
@katarzynakaz katarzynakaz added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 2, 2026
Comment on lines +22 to +23
self.tracker_number = 0
self.our_list = []
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Try implement the linked list without involving an array and tracker_number; they may steer you in the wrong direction.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

our_list is removed as requested, I kept the tracker number to practice assigning ids to elements

Copy link
Copy Markdown

@cjyuan cjyuan Mar 4, 2026

Choose a reason for hiding this comment

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

Follow-up with this comment: #117 (comment)

What do you mean by "assigning ids to elements"? Why do you need to assign id to elements?

In your implementation, I don't see how you use tracker_number in the linked list, and I don't see how the tracker property in node is used. The tracker property is always assigned None.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 2, 2026
@katarzynakaz katarzynakaz 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
Copy Markdown

cjyuan commented Mar 3, 2026

I don’t see any updates, and I don't see any response to my feedback.

Did you forget to push your changes to GitHub?
Can you also respond to my comments?

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 3, 2026
@katarzynakaz
Copy link
Copy Markdown
Author

the requested changes are implemented

@cjyuan
Copy link
Copy Markdown

cjyuan commented Mar 4, 2026

I still do not see any new commits on this PR branch. Did you made your commits on another branch?

@katarzynakaz
Copy link
Copy Markdown
Author

Thank you for the feedback. Not sure what happened as I pushed changes to this branch. The requested changes are now implemented.

@katarzynakaz katarzynakaz added NotCoursework Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 4, 2026
Copy link
Copy Markdown

@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 code in linked_list_test.py expects both .next and .previous properties of the removed node to be assigned None. Currently your implementation could not pass the tests.

Note: Do you know the why it is a good practice to assign .next and .previous of the removed node to None?

class Node:
def __init__(self, tracker, inserted_item_key):
self.tracker = tracker
self.inserted_item_key = inserted_item_key
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Typically a linked list node store some data in addition to the next and previous references.
You could name the property data or value if you needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thank you, I implemented all the requested changes. Since it now returns the node obj, the tracker is unnecessary and I deleted it. I didn't realize there was a standard naming convention and have renamed it. I understand adding None is good practice because it removes the node's references to the active list.

Comment on lines +22 to +23
self.tracker_number = 0
self.our_list = []
Copy link
Copy Markdown

@cjyuan cjyuan Mar 4, 2026

Choose a reason for hiding this comment

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

Follow-up with this comment: #117 (comment)

What do you mean by "assigning ids to elements"? Why do you need to assign id to elements?

In your implementation, I don't see how you use tracker_number in the linked list, and I don't see how the tracker property in node is used. The tracker property is always assigned None.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 4, 2026
@katarzynakaz katarzynakaz added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 10, 2026
Copy link
Copy Markdown

@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.

Changes look good.


return wrapped_item

def remove(self, id_for_this_particular_item):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • for_this_particular does not carry much useful info.

  • Why not just name the parameter node_to_remove?

@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 10, 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. 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants