InterviewSolution
| 1. |
How To Implement Lru Cache In Java Using Linked List? |
|
Answer» An LRU cache is the cache where you REMOVE LEAST recently used an element when the cache is full or about to fill. It's relatively easy in JAVA if you are allowed to use one of the Collection class e.g. you can use a LINKEDHASHMAP to implement LRU cache in Java, but you should also PREPARE how you can use a doubly linked list to create an LRU cache. An LRU cache is the cache where you remove least recently used an element when the cache is full or about to fill. It's relatively easy in Java if you are allowed to use one of the Collection class e.g. you can use a LinkedHashMap to implement LRU cache in Java, but you should also prepare how you can use a doubly linked list to create an LRU cache. |
|