MCPcopy
hub / github.com/careercup/ctci / push

Method push

java/Chapter 3/Question3_3/Stack.java:22–30  ·  view source on GitHub ↗
(int v)

Source from the content-addressed store, hash-verified

20 }
21
22 public boolean push(int v) {
23 if (size >= capacity) return false;
24 size++;
25 Node n = new Node(v);
26 if (size == 1) bottom = n;
27 join(n, top);
28 top = n;
29 return true;
30 }
31
32 public int pop() {
33 Node t = top;

Callers 14

mergesortMethod · 0.95
sortMethod · 0.95
mainMethod · 0.95
pushMethod · 0.95
leftShiftMethod · 0.95
isPalindromeMethod · 0.95
findKthElementFromEnd4Function · 0.45
shiftStacksFunction · 0.45
3_5.jsFile · 0.45
3_5_Spec.jsFile · 0.45
addMethod · 0.45
shiftStacksMethod · 0.45

Calls 1

joinMethod · 0.95

Tested by

no test coverage detected