Skip to content

Manchester | 26-SDC-Jun | Fithi Teklom | Sprint 2 | Implement Skip List - #263

Open
Fithi-Teklom wants to merge 1 commit into
CodeYourFuture:mainfrom
Fithi-Teklom:feature/implement-skip-list
Open

Fithi-Teklom wants to merge 1 commit into
CodeYourFuture:mainfrom
Fithi-Teklom:feature/implement-skip-list

Conversation

@Fithi-Teklom

@Fithi-Teklom Fithi-Teklom commented Oct 18, 2026 •

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

Task code

CYF-1185

Changelist

Implement skip list insert, search, and to_list methods

@github-actions

This comment has been minimized.

@Fithi-Teklom Fithi-Teklom added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Oct 19, 2026
class Node:
__slots__ = ("value", "forward")

def __init__(self, value: int, level: int) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why restrict the value type to int?

Have you performed static type checking on the python script?

Comment on lines +24 to +25
return level
def insert(self, value: int) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Adding a blank line to separate two logically independent blocks of code could improve readability.

Comment on lines +30 to +34
while current.forward[level] is not None:
if current.forward[level].value < value:
current = current.forward[level]
else:
break

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Note: Code on line 30-34 could be simplified into a while-loop without using if-else. The same also applies to the while loop in contains() .

if node_level > self.level:
for i in range(self.level + 1, node_level + 1):
update[i] = self.head
self.level = node_level

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code on line 44 does not seem to depend on the loop.

@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 Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants