![SOLVED: Question 2 1 pts (Acuña) Select the functions from the following list that could belong to an ADT. (Hint: ask yourself if these methods belong in an idealistic ADT, i.e. one SOLVED: Question 2 1 pts (Acuña) Select the functions from the following list that could belong to an ADT. (Hint: ask yourself if these methods belong in an idealistic ADT, i.e. one](https://cdn.numerade.com/ask_images/36f1a89cc3574fbab78f95316d73fa15.png)
SOLVED: Question 2 1 pts (Acuña) Select the functions from the following list that could belong to an ADT. (Hint: ask yourself if these methods belong in an idealistic ADT, i.e. one
![SOLVED: My code so far: import java.util.ArrayList; public class MyStack<E> private ArrayList<E> list = new ArrayList<>(); public int getSize() return list.size(); public E peek() return list.get(getSize() -1); public void push(E o) list.add(o); SOLVED: My code so far: import java.util.ArrayList; public class MyStack<E> private ArrayList<E> list = new ArrayList<>(); public int getSize() return list.size(); public E peek() return list.get(getSize() -1); public void push(E o) list.add(o);](https://cdn.numerade.com/ask_images/28e8eea968ef4f61a3375b5dd530c4c8.jpg)
SOLVED: My code so far: import java.util.ArrayList; public class MyStack<E> private ArrayList<E> list = new ArrayList<>(); public int getSize() return list.size(); public E peek() return list.get(getSize() -1); public void push(E o) list.add(o);
Stack: What problems does it solve? Simple stack example Implementation is very simple Uses rather than "is-a"
![1 CSC 222: Computer Programming II Spring 2005 Stacks and recursion stack ADT push, pop, peek, empty, size ArrayList-based implementation, java.util.Stack. - ppt download 1 CSC 222: Computer Programming II Spring 2005 Stacks and recursion stack ADT push, pop, peek, empty, size ArrayList-based implementation, java.util.Stack. - ppt download](https://images.slideplayer.com/24/6976853/slides/slide_5.jpg)