How to implement LRU cache using HashMap and Doubly Linked List

LRU cache stand for Least Recently Used Cache. which evict least recently used entry. As Cache purpose is to provide fast and efficient way of retrieving data. it need to meet certain requirement.

Some of the Requirement are

  1. Fixed Size: Cache needs to have some bounds to limit memory usages.
  2. Fast Access: Cache Insert and lookup operation should be fast , preferably O(1) time.
  3. Replacement of Entry in case , Memory Limit is reached: A cache should…