MCPcopy
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
43class DoubleLinkedList {

Callers

nothing calls this directly

Calls 4

peekMaxMethod · 0.95
unlinkMethod · 0.80
getMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected