ArrayList Practice Quiz
Practice Problem
Take out a piece of paper and put your name on the upper right corner.
Write the following method for the ArrayList class:
public class ArrayList<E> implements List<E> {
/** Holds the items in the list. */
private E[] data;
/** The size of the list. */
private int size;
public E add(int index, E item) {
// your code here.
}
}
Be sure to write JavaDoc comments for your code.
Conduct a quick review of your code, before you are done.
After the code, write an explanation the Big-O performance of the add method.
Time Remaining:
You can restart the timer by reloading the page.
Try to complete the problem in 20 minutes.
If you cannot complete the program in 20 minutes, you can watch me solve the problem in a text editor.