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

Method add

java/716_Max_Stack.java:53–59  ·  view source on GitHub ↗
(int val)

Source from the content-addressed store, hash-verified

51 }
52
53 public Node add(int val) {
54 Node x = new Node(val);
55 x.next = tail;
56 x.prev = tail.prev;
57 tail.prev = tail.prev.next = x;
58 return x;
59 }
60
61 public int pop() {
62 return unlink(tail.prev).val;

Callers 1

pushMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected