You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
627 B

6 years ago
  1. // The NumberStack interface
  2. // Do not make any changes to this file!
  3. // Xiwei Wang
  4. public interface NumberStack
  5. {
  6. boolean isEmpty(); // check whether the stack is empty
  7. boolean isFull(); // check whether the stack is full
  8. int top(); // return the element at the top of the stack
  9. int pop(); // remove and return the element at the top of the stack
  10. void push(int v); // push a value onto the stack
  11. int size(); // return the number of elements on the stack
  12. @Override
  13. String toString(); // return a string representation of the stack
  14. }