1. Repeat the previous exercise, but define the method to Array instead of the method display.
2. Suppose that the ADT stack included a void method remove(n) that removes the topmost n entries from a stack. Specify this method by writing comments and a header. Consider the possible outcomes for stacks that do not contain at least n entries.
3. Repeat Exercise 3, but define the method remove(n), as described in the previous exercise, instead of the method display.
4. Imagine a linked implementation of the ADT stack that places the top entry of the stack at the end of a chain of linked nodes. Describe how you can define the stack operations push, pop, and peek so that they do not traverse the chain.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here