Implement the following List interface using an array to store the data.
public interface List211<E> {
boolean add(E e);
void add(int index, E element);
E remove(int index);
E get(int index);
E set(int index, E element);
int indexOf(Object obj);
int size();
}Name your class MyArrayList.
In addition to the List interface implement the following sort methods:
public class MyArrayList<E> implements List211<E> {
private E[] data;
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 array. 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 MyArrayList 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.