Implement the following List interface using a DLinkedNode<E> to store the data.
public interface List211<E> {
boolean add(E e);
void add(int index, E element);
E get(int index);
E remove(int index);
E set(int index, E element);
int size();
}Name your class MyLinkedList.
In addition to the List interface implement the following sort methods:
public class MyLinkedList<E> implements List211<E> {
private DLinkedNode<E> head;
private DLinkedNode<E> tail;
private int size;
public void insertionSort(Comparator<? super E> compare);
public void bubbleSort(Comparator<? super E> compare);
public void selectionSort(Comparator<? super E> compare);Use the Comparator to compare the items in the list. The sort methods should sort the list in ascending order, smallest at the beginning, largest at the end.
Download and use the Contact.java and ContactComparator.java classes to creat a ContactList that automatically sorts the list when ever a new contact is added to the list. You should use your MyLinkedList class as the basis of your ContactList.
Please thoroughly test your code and briefly discuss your testing strategy. Make sure that you test the different sorting algorithms. Turn in all your test code.
The assignment is due on Friday at 11:55pm. You may turn it in early.