Hi, I want to implement a delegate solution for Bubble sort. I have this code:
public delegate void SortHandler<T>(IList<T> t);
public static void Sort<T>(IList<T> arr, SortHandler<T> func)
{
func(arr);
}
int[] arr2 = { 10,1,2,3,4 };
CollectionHelper.Sort<int>(arr2, bubble_sort);
bubble sort function signature is:
static void bubble_sort(int[] array) {}
I get this error:
Argument '2': cannot convert from 'method group' to 'DelegatesAndGenerics.SortHandler