binary_search.h (355B)
1 #ifndef BINARY_SEARCH_H 2 #define BINARY_SEARCH_H 3 4 // binary_search expects: 5 // val: an integer value to search 6 // arr[]: an array of *sorted* integers 7 // len: the length of ARR[] 8 // If val is found, the function returns a pointer to an array index. 9 // Otherwise, it returns NULL. 10 int* binary_search(int val, int arr[], int len); 11 12 #endif // BINARY_SEARCH_H