LRU cache implementation
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 fixed size:cache need to have some bounds to limit memory usages. Fast Access:Cache Inert and lookup operation should be fast, preferably O(1) time Replacement of Entry in case,Memory Limit is reached:A cache shoule have efficient algorithm to evict when memory is full. In case of LRU cache we evict least recently used entry so we have to keep track of recently used entries, entries which have not been used from long time and which have been used recently, plus lookup and insertion operation should be fast enough . When we think about O(1) lookup, obvious data structure comes in our mind is HashMap.HashMap provide……