Rewrite this C# function to use the more generic T and \"array of T\'\' data typ
ID: 664185 • Letter: R
Question
Rewrite this C# function to use the more generic T and "array of T'' data type in place of int and array of integers: public int BinarySearch(int searchElement, int [] data) { int low = 0; int high = data.Length - 1; int middle = (low + high + 1) / 2; int location = -1; do { if ( searchElement == data[middle] ) location = middle; else if ( searchElement < data[middle] ) high = middle - 1; else low = middle + 1; middle = (low + high + 1) / 2; } while (( low <= high ) && (location == -1)); return location }