Type 1 - Incorrect capacity
Closed this issue · 1 comments
chaoexit commented
The capacity of type 1 stack is always initialized at -1
Example:
Stack stack = StackFactory.makeStack(2);
stack.capacity();
Expected result : 2
Actual result : -1
jbrucker commented
Good example.
The last statement doesn't yield any result, though.
Could be:
int cap = stack.capacity(); // sets cap = -1