注意哦,get 和put 方法必须都是 O(1) 的时间复杂度,我们举个具体例子来看看LRU 算法怎么工作。 /* 缓存容量为2 */ LRUCache cache = new LRUCache(2); // 你可以把cache ...
確定! 回上一頁