MCPcopy Create free account
hub / github.com/careercup/ctci / expand

Method expand

java/Chapter 3/Question3_1/QuestionB.java:82–85  ·  view source on GitHub ↗
(int stackNum)

Source from the content-addressed store, hash-verified

80
81 /* Expand stack by shifting over other stacks */
82 public static void expand(int stackNum) {
83 shift((stackNum + 1) % number_of_stacks);
84 stacks[stackNum].capacity++;
85 }
86
87 static void push(int stackNum, int value) throws Exception {
88 StackData stack = stacks[stackNum];

Callers 1

pushMethod · 0.95

Calls 1

shiftMethod · 0.95

Tested by

no test coverage detected