import java.util.*; public class LinkedList implements List { Node head; Node tail; public void addFirst(Object o) { } // addFirst public void addAfter(Object newO, Object after) { } // addAfter public void add(Object o) { Node newNode = new Node(o); if (head == null) tail = head = newNode; else tail = tail.next = newNode; } // add public void delete(Object o){} public boolean find(Object o) { Node current = head; while (current != null) { if (current.data.equals(o)) return true; current = current.next; } // while return false; } // find public void print() { Node current = head; while (current != null) { System.out.println(current.data); current = current.next; } // while } // print public Enumeration elements() { return new ListEnumeration(); } // elements private class ListEnumeration implements Enumeration { Node current = head; public boolean hasMoreElements() { if (current == null) return false; return true; } // hasMoreElements public Object nextElement() { Object theNext = current.data; current = current.next; return theNext; } // nextElement } // class ListEnumeration private class Node { Object data; Node next; Node(Object o, Node n) { data = o; next = n; } // constructor Node(Object o) { data = o; } // constructor } // class Node } // class LinkedList