Explorar el Código

Add prev to Node class (#82)

For managing an LRU cache, we need to use a doubly linked list for move_to_front() operation.
Ian Park hace 8 años
padre
commit
17e5fb7d32
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      solutions/object_oriented_design/lru_cache/lru_cache.ipynb

+ 2 - 1
solutions/object_oriented_design/lru_cache/lru_cache.ipynb

@@ -56,7 +56,8 @@
     "\n",
     "    def __init__(self, results):\n",
     "        self.results = results\n",
-    "        self.next = next\n",
+    "        self.prev = None\n",
+    "        self.next = None\n",
     "\n",
     "\n",
     "class LinkedList(object):\n",