mirror of
				https://github.com/donnemartin/system-design-primer.git
				synced 2025-11-04 02:02:31 +03:00 
			
		
		
		
	Add prev to Node class (#82)
For managing an LRU cache, we need to use a doubly linked list for move_to_front() operation.
This commit is contained in:
		@@ -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",
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user