commit e50959488ae2ed6f7aaa234be983e6786167499c parent 708916b4caf6fcff9fbd9ce3d6a9da63043e5069 Author: dwrz <dwrz@dwrz.net> Date: Wed, 26 Jun 2019 08:04:32 +0000 Refactor c/binary_search header Diffstat:
M | c/binary-search/src/binary_search.h | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/c/binary-search/src/binary_search.h b/c/binary-search/src/binary_search.h @@ -1 +1,12 @@ +#ifndef BINARY_SEARCH_H +#define BINARY_SEARCH_H + +// binary_search expects: +// val: an integer value to search +// arr[]: an array of *sorted* integers +// len: the length of ARR[] +// If val is found, the function returns a pointer to an array index. +// Otherwise, it returns NULL. int* binary_search(int val, int arr[], int len); + +#endif // BINARY_SEARCH_H