ArrayBoundedStack stack = new ArrayBoundedStack(5);
stack.push(5);
stack.push(5);
stack.push(2);
stack.push(3);
Would the order of the elements, from bottom to top, be 5,5,2,3?
ArrayBoundedStack stack = new ArrayBoundedStack(5);
stack.push(5);
stack.push(5);
stack.push(2);
stack.push(3);
Would the order of the elements, from bottom to top, be 5,5,2,3?
A stack is a last-in-first-out structure; that means if you were to pop four times after doing this, you'd get 3, 2, 5, 5.
Whether the stack actually grows up or down I think is a problem at a lower level (like the processor maybe), so thinking about it in terms of bottom or top isn't necessarily useful. Though I guess if by "top" you mean "item that would be popped first", then you've got it pretty much right