Add prev to Node class
For managing LRU cache, we need to use a doubly linked list for move_to_front() operation.pull/82/head
parent
e168c588f5
commit
87d90f18ae
|
@ -56,7 +56,8 @@
|
||||||
"\n",
|
"\n",
|
||||||
" def __init__(self, results):\n",
|
" def __init__(self, results):\n",
|
||||||
" self.results = results\n",
|
" self.results = results\n",
|
||||||
" self.next = next\n",
|
" self.prev = None\n",
|
||||||
|
" self.next = None\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"class LinkedList(object):\n",
|
"class LinkedList(object):\n",
|
||||||
|
|
Loading…
Reference in New Issue