ok, this is for Int types. My problem is that i have to use InterpolationSearch for Strings. For numbers sure it works fine.
Can someone help me with this algorithm please?
public static int InterpolationSearch(int[] a, int x,int low,int high) { // x = key of search int mid; while(low<=high) { mid=low+(high-low)*((x-a[low])/(a[high]-a[low])); if(x==a[mid]) return mid+1; if(x<a[mid]) high=mid-1; else low=mid+1; } return -1;