Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/qiyuangong/leetcode
/ popMax
Method
popMax
java/716_Max_Stack.java:33–40 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
31
}
32
33
public
int
popMax() {
34
int
max = peekMax();
35
List<Node> L = map.get(max);
36
Node node = L.remove(L.size() - 1);
37
dll.unlink(node);
38
if
(L.isEmpty()) map.remove(max);
39
return
max;
40
}
41
}
42
43
class
DoubleLinkedList {
Callers
nothing calls this directly
Calls
4
peekMax
Method · 0.95
unlink
Method · 0.80
get
Method · 0.45
remove
Method · 0.45
Tested by
no test coverage detected