// an alternative implementation of LinkedList that does not require // a separate case for the head node public class LinkedList2 { private Node head; private int size; public LinkedList2(){ head = new Node(null); size = 0; } public void clear() { head = new Node (null);; } public void add(Object item) { add(size, item); } public void add(int index, Object item) { if (index<0 || index>size) throw new IndexOutOfBoundsException ("List index out of bounds on add"); Node curr = head.getNext(); for (int i=0; i= size) throw new IndexOutOfBoundsException ("List index out of bounds on remove"); Node curr = head.getNext(); for (int i=0; i