Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/wangzheng0822/algo
/ update
Method
update
java/06_linkedlist/LRUBasedArray.java:60–65 ·
view source on GitHub ↗
若缓存中有指定的值,则更新位置 @param end
(int end)
Source
from the content-addressed store, hash-verified
58
* @param end
59
*/
60
public
void
update(
int
end) {
61
T target = value[end];
62
rightShift(end);
63
value[0] = target;
64
holder.put(target, 0);
65
}
66
67
/**
68
* 缓存数据到头部,但要先右移
Callers
1
offer
Method · 0.95
Calls
2
rightShift
Method · 0.95
put
Method · 0.45
Tested by
no test coverage detected