I have a method in the class EarthquakeDataSet called public void mergeSort() where I create an object and try to call a sort() method from my MergeSorter class. The MergeSorter class itself is not my code, it's written by someone else but I'm supposed to call the sort() and use this class that someone else has written. The exact error I'm getting is: "The method sort(E[],Comparator ) in the type MergeSorter is not applicable for arguments"
My method in EarthquakeDataSet looks like this:
public void mergeSort(){
MergeSorter obj = new MergeSorter();
obj.sort();
}
The method in MergeSorter I'm trying to call, calls another method, which also calls another method. This is my MergeSorter class.
The three methods in MergeSorter looks like this:
public static <E> void sort(E[] a, Comparator<? super E> comp) {
mergeSort(a, 0, a.length - 1, comp); //calling mergeSort method
}
and
private static <E> void mergeSort(E[] a, int from, int to, Comparator<? super E> comp){
}
and
private static <E> void merge(E[] a, int from, int mid, int to, Comparator<? super E> comp) {
}
There's a fair bit of code inside but I'm just having trouble calling with these arguments.