Repository navigation
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
Now that you have implemented the Skip list once. Could you reproduce the code from scratch without consulting AI?
| def __contains__(self, value): | ||
| return self.contains(value) |
There was a problem hiding this comment.
What's the purpose of including this __contains__() method?
There was a problem hiding this comment.
Thank you for asking.I included contains() to allow the skip list to support Python's in operator, so users can check membership with value in skip_list instead of calling skip_list.contains(value) directly. It delegates to the existing contains() method to avoid duplicating the search logic. Are you happy with it.
|
sorry i can not reproduce the code from scratch on my own at the moment because i have not done enough review while i am suffering from code this week. Hopefully I can do at the end of next week. |
|
Skip list is is relatively hard to implement. For example, this video gives a good illustration of how Skip List works: https://www.youtube.com/watch?v=UGaOXaXAM5M |
|
Thank you for valuable suggestion, i will do as you directed |
Self checklist
Task code
CYF-1185
Changelist
very hard to complete this coursework with lots of AL help and explanation due to that i can not understand some code so definitely require lots of review as well.