MCPcopy
hub / github.com/qiyuangong/leetcode / push

Method push

java/716_Max_Stack.java:10–15  ·  view source on GitHub ↗
(int x)

Source from the content-addressed store, hash-verified

8 }
9
10 public void push(int x) {
11 Node node = dll.add(x);
12 if(!map.containsKey(x))
13 map.put(x, new ArrayList<Node>());
14 map.get(x).add(node);
15 }
16
17 public int pop() {
18 int val = dll.pop();

Callers 1

findUnsortedSubarrayMethod · 0.45

Calls 4

containsKeyMethod · 0.80
addMethod · 0.45
putMethod · 0.45
getMethod · 0.45

Tested by 1

findUnsortedSubarrayMethod · 0.36