/////// File: bsearch.h /////// // Geenric binary search template template int bsearch(T1 arr[], // ordered array of any type T1 T2 key, // search key of any type T2 int low, int high, // inclusive search range int (* cmp)(T1, T2) // comparison function ); // cmp(arr[i], key) compares arr[i] with key and returns -1, 0, +1 // bsearch returns the index of the entry found or -1 if not found