This application is currently written to demonstrate a simple version of the Binary Search using an array of double values. Modify the BinarySearch method provided to be a generic method so that it may be called using a variety of array data types such as int and string . You will need to use a where clause with the BinarySearch method that requires that the element type implement the IComparable interface. This will allow you to use method CompareTo to compare elements in the array. Recall, CompareTo is called like: a.CompareTo(b) In this example, if the method returns a negative value, this means a < b. If the method returns a zero value, this means that a == b. If the method returns a positive value, this means a > b. The application also includes code that is currently commented out that is designed to test your generic BinarySearch method with an array of int values. Be sure to enable this code to ensure that your modifications will work with both types.
public class GenBinSearchTest : IComparer