LRU 算法

LRU 算法

LRU (最近最少使用) 缓存机制

/**
 * @param {number} capacity
 */
var LRUCache = function(capacity) {

};

/** 
 * @param {number} key
 * @return {number}
 */
LRUCache.prototype.get = function(key) {

};

/** 
 * @param {number} key 
 * @param {number} value
 * @return {void}
 */
LRUCache.prototype.put = function(key, value) {

};

/**
 * Your LRUCache object will be instantiated and called as such:
 * var obj = new LRUCache(capacity)
 * var param_1 = obj.get(key)
 * obj.put(key,value)
 */

refs

https://leetcode-cn.com/problems/lru-cache/

https://www.geeksforgeeks.org/program-for-least-recently-used-lru-page-replacement-algorithm/

https://en.wikipedia.org/wiki/Cache_replacement_policies

LRU 算法_第1张图片


Flag Counter

©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


你可能感兴趣的:(LRU 算法)