CS231 lecture notes, Fall 1998 Week 8, Monday Quiz Wednesday on the homework preparation. 1) Implementation of stacks a) using arrays b) using lists (this time the lists are implemented internally) Most of this is almost identical to the array implementation of PriorityQueue: public class Stack { private int count; private int capacity; private int capacityIncrement; private Object[] itemArray; public Stack () { count = 0; capacity = 10; capacityIncrement = 10; itemArray = new Object[capacity]; } public boolean empty () { return (count == 0); } public void push (Object obj) { if (count == capacity) { capacity += capacityIncrement; capacityIncrement *= 2; Object[] tempArray = new Object[capacity]; for (int i=0; i