I would like to implement the java Arrays.binarySearch method for binarySearch(double[], double), but in C language. Something similar is described here but for a character array, and it is not described well enough. How should I do it? Is it already implemented anywhere else (GSL library, etc)?
I would like to implement the java Arrays.binarySearch method for binarySearch(double[], double) , but
Share
If you are using a C++ compiler, take a look at std::binary_search.
Update
Also take a look at
stdlib.h(ANSI C) bsearch. Since you are working directly with arrays, I think this is the function that best fits the job.