1. Discuss the difference between using an array and using a Python list to implement the class ArrayStack. What are the trade-offs? 2. Add code to the methods peek and pop in ArrayStack so that they...


1. Discuss the difference between using an array and using a Python list to implement the class ArrayStack. What are the trade-offs?


2. Add code to the methods peek and pop in ArrayStack so that they raise an exception if their preconditions are violated.


3. Modify the method pop in ArrayStack so that it reduces the capacity of the array if it is underutilized.



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here