You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
This package provides a Matlab implementation of a LRU cache. An LRU cache is a container of (key, value) pairs with some upper limit on size. Whenever a new element is added that would go over this limit, the least-recently-used item is discarded. This implementation allows for a limit either on the total number of items and/or on the total memory usage in bytes. This makes it a useful tool for caching results in memory while keeping the size of the cache under a pre-specified limit, for example.
The file `LRU.m` contains the class definition for the cache. `DLL.m` contains a simple doubly-linked list, which is needed inside of `LRU`. `testLRUCache.m` contains three simple test cases that also serve as examples.
Cite As
Richard Lange (2026). Least-Recently Used (LRU) Cache (https://in.mathworks.com/matlabcentral/fileexchange/68836-least-recently-used-lru-cache), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0 (3.36 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0 |
