So, I have got a problem in my Main class when I would like to call the mergeSort() method caused by the Comparator. I get the following message:
I have no idea how to fix that issue.. please help me!
Notice: Don't wonder that there doesn't happen anything in the code. I got stuck because I cannot prove the functionality of my code because of the above described problem :(
(Sry for my bad english)
class Algorithms
{
public static <T> void mergeSort(final T[] a, final Comparator<T> c)
{
T[] list = a;
Comparator<T> comp = c;
}
}
public class Main
{
public static void main(String[] args)
{
int[] unsortedList = {4,5,7,1,98,32}; //Expected = 1,4,5,7,32,98
Comparator<Integer> sorted = Comparator.naturalOrder();
int[] sortedList = Algorithms.mergeSort(unsortedList,sorted))
}
}
