Practice: ArrayList

Take out a piece of paper. We’ll be programming on paper.

Problem 1

public class ArrayList<E> implements List211<E> {
  /** Holds the items in the list. */
  private E[] data;
  /** The size of the list. */
  private int size;

  /**
   * Constructs an empty list with an initial capacity of ten.
   */
   public ArrayList() {
     // your steps / code goes here
   }
   
  /**
   * Removes the element at the specified position in this list. Shifts any subsequent elements to the 
   * left (subtracts one from their indices).
   * @param index the index of the element to be removed
   * @return the element that was removed from the list.
   * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size())
   */
   public E remove(int index) {
     // your steps / code goes here.
   }
}

Problem 2

Show me your code before you leave