Loading tutorials
move_to_front, which combines two of them.2 min readNode and DoublyLinkedList classes from the previous chapter in the same file. It also assumes you are comfortable with Python dictionaries and with O(1) versus O(n) costs.2 min readNode and DoublyLinkedList classes from the earlier chapters (sentinel head and tail, add_front, remove, move_to_front, pop_back). It also assumes you have a get that promotes the entry it reads. Here we write put.2 min readput. It assumes you can read Python classes and dictionaries, know Big-O notation, and have followed the earlier chapters on the hash map, the doubly linked list with sentinel nodes, and the get and put operations.2 min readLRUCache, Node, and DoublyLinkedList classes from the earlier chapters and know Big-O notation. Here you add up the cost of each step in get and put, then confirm the result by measuring.2 min readNode, DoublyLinkedList, and LRUCache classes from the earlier chapters, saved together in a file named lru.py. It also assumes you know basic unittest.1 min readLRUCache from the earlier chapters. You should know Python classes, dictionaries, and Big-O notation. Here you compare your hand-built cache with two tools in the standard library.2 min readLRUCache from the earlier chapters and know Python's threading module at a basic level. You will add a lock so several threads can share one cache.2 min readLRUCache from the earlier chapters: a dictionary mapping keys to nodes, plus a doubly linked list with sentinel nodes. It sketches three extensions and points to alternative eviction policies.2 min read