Question: Java 22. (3.5 points) Assume that you use a dynamic array A as your internal storage to implement a stack. Fill the table to indicate
Java

22. (3.5 points) Assume that you use a dynamic array A as your internal storage to implement a stack. Fill the table to indicate how you use A to implement a stack with the best possible big-0 running time. You can only use dynamic array methods listed in the table below in your answer - no other methods or attributes of A are available. Method size() Dynamic array Description Return number of items in the array insert(i,x) Insert an item x at index i remove(i) get(i) Remove item stored at index i Return item stored at index i Method push(x) pop() top() Stack LI FO Implementation with a dynamic array A, inser + (sizel (+)); X? Auinsere Chisic OR A remove (Size CH1; LEMONLAMPILITY A. ge+ (sl2c (>) 1 Diger Innshe 13-14 Note: your answer should be valid method calls using A. Additional explanation is NOT required and should be NO more than one line for each stack method if included. Only the first line will be graded if multiple lines are present.
Step by Step Solution
There are 3 Steps involved in it
Stack Method size pushx pop top Method Implemen... View full answer
Get step-by-step solutions from verified subject matter experts
