/* * This is LinkedList is very similar to the one * we defined in class. I added a toString() method * for your convenience. * * IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT IMPORTANT * * You should implement the find(), remove(), toString() and * insertInOrder() methods. */ public class LinkedList { private Node head; private Node tail; /* * Constructor. By default, set all the references * to null */ public LinkedList() { head = null; tail = null; } /* * You should implement this method. It should * return the item if it is found in the list and * null otherwise. It should rely on the ".equals()" * or ".compareTo()" to do the comparison */ public Comparable find (Comparable find_me) { /* * Your code here */ return null; // Change this, as appropriate; just for compilation } /* * You should implement this method. It should * remove the first instance of the specified item * from the list. If the item is not in the list, * it should fail silently */ public void remove (Comparable remove_me) { /* * Your code here */ } /* * You should implement this method. It should * insert an item into the list "in order", that * is to say, it should insert the item after before * the first item it finds with a greater value as * reported by compareTo(), or at the beginning in an * empty list, or at the end of the list, if it is the greatest. * * For this method to be truly useful, it should be used * as the exclusive method of inserting into the list. */ public void insertInOrder (Comparable remove_me) { /* * Your code here */ } public String toString() { return ""; } }