LinkedList add Quiz
Take out a piece of paper and put your name on the upper right corner.
Write a Generic Java class LinkedList<E> that has one method:
public class LinkedList<E> implements List<E> {
/** Holds the head of the list. */
private LinkedNode<E> head;
/** The size of the list. */
private int size;
public E add(E item) {
// Your code goes here.
}
}
The method must add the item to the end of the list.
Be sure to write JavaDoc comments for your code.
Conduct a quick review of your code, before you turn it in.
After the code, write an explanation the Big-O performance of the add method.
Hand in your code when you are done.
Take a short break and be back in your seats at
Time remaining: