Question: import java.util.ArrayList; public class MyStack { private ArrayList list = new ArrayList(); public boolean isEmpty() { return list.isEmpty(); } public int getSize() { return list.size();
import java.util.ArrayList; public class MyStack { private ArrayList
ASSIGNMENT 3 Arrays and ArrayList Submission Deadline Friday 19/3/2021 11:30 PM Implement the class MyStack (Chapter 11, slides 47 & 48) using normal arrays. Start your array with size 5. When push is called, if the array is full, replace it with an array that has the double of the original size and copy all elements in the new array. When pop is called and the number of elements in the array is less that the half of the available cells, replace the array with another one that has half the size and copy all elements in the new array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
