SSD2015/Stack

Type 1 - Incorrect capacity

Closed this issue · 1 comments

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

Good example.
The last statement doesn't yield any result, though.
Could be:
int cap = stack.capacity(); // sets cap = -1