MCPcopy Index your code
hub / github.com/Tiwarishashwat/InterviewCodes / pop

Method pop

DesignAStackWithIncrements.java:24–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22 }
23
24 public int pop() {
25 if(isEmpty()){
26 return -1;
27 }
28 int val = stack[index];
29 val += operations[index];
30 if(index>0){
31 operations[index-1] += operations[index];
32 }
33 operations[index] = 0;
34 index--;
35 size--;
36 return val;
37 }
38
39 public void increment(int k, int val) {
40 if(isEmpty()){

Callers 15

inorderTraversalMethod · 0.80
preorderTraversalMethod · 0.80
minAddToMakeValidMethod · 0.80
canBeValidMethod · 0.80
isValidMethod · 0.80
findMaxMethod · 0.80
maxWidthRampMethod · 0.80
minLengthMethod · 0.80
countOfAtomsMethod · 0.80
parseBoolExprMethod · 0.80
kosarajuMethod · 0.80
minSwapsMethod · 0.80

Calls 1

isEmptyMethod · 0.95

Tested by

no test coverage detected