LRU Cache: An Introduction and Implementation in Go

LRUCache: An implementation in Go

Introduction: An LRUCache is a data structure that uses the scheme of evicting the Least Recently Used item. Basically a cache is a mechanism used by software to effectively handle data access and reading in an efficient manner. Caching improves performances by recently used or frequently used in memory. Using a cache, we avoid the overhead required to fetch an item that is already in memory. LRU (Least Recently Used) is one cache mechanism where we evict an item that is not used to make rooms for new items to be added. Some other popular caching mechanisms are MRU, LFU, etc.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store