Repository navigation
Glasgow | 26-Jul-SDC | Shreef Ibrahim | Sprint 2 |ImplementLRUcachePython - #252
shreefAhmedM wants to merge 2 commits into
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
To better adhere to the Single-Responsibility Principle (SRP) from SOLID design principles, it's preferable to implement the "doubly linked list" and the "LRU Cache" as separate classes, with the linked list used inside LruCache to manage ordering.
You could copy your linked_list.py to this folder and use it.
Alternatively, you could use a suitable Python built-in class.
Could you update your code using one of these approaches?
Thanks for the feedback. I've updated the implementation to use Python's built-in OrderedDict to manage cache ordering and LRU eviction, removing the need for a custom doubly linked list. I've kept the existing interface and tests compatible. |
|
Looks good. |
Self checklist
Task code
CYF-1181
Changelist