MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / pushRight

Method pushRight

javascript/0460-lfu-cache.js:44–50  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

42 }
43
44 pushRight(val) {
45 let newNode = new ListNode(val, this.Right);
46 newNode.prev = this.Right.prev;
47 newNode.prev.next = newNode;
48 this.Right.prev = newNode;
49 this.map.set(val, newNode);
50 }
51
52 update(val) {
53 this.pop(val);

Callers 3

updateMethod · 0.95
LFUCacheFunction · 0.80
maxSlidingWindowFunction · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected