(int stackNum)
| 32 | } |
| 33 | |
| 34 | static int pop(int stackNum) throws Exception { |
| 35 | if (isEmpty(stackNum)) { |
| 36 | throw new EmptyStackException(); |
| 37 | } |
| 38 | int value = buffer[absTopOfStack(stackNum)]; // Get top |
| 39 | buffer[absTopOfStack(stackNum)] = 0; // Clear index |
| 40 | stackPointer[stackNum]--; // Decrement pointer |
| 41 | return value; |
| 42 | } |
| 43 | |
| 44 | static int peek(int stackNum) { |
| 45 | if (isEmpty(stackNum)) { |
no test coverage detected