Least Recently Used Cache Algorithm
I practice algorithms everyday. My go to websites for algorithm practice are leetcode.com and algoexpert.io
This particular problem is on leetcode.com titled LRU Cache. Least Recently Used Cache is helpful for removing old cache items thereby maintaining a fixed memory space and limiting the cache size for faster cache searches.
You can imagine where this would be useful such as page searches, frequent word use, or load-balancing servers.
The inputs are:
Cache Capacity as an integer.
The methods are: