From e50959488ae2ed6f7aaa234be983e6786167499c Mon Sep 17 00:00:00 2001 From: dwrz Date: Wed, 26 Jun 2019 08:04:32 +0000 Subject: [PATCH] Refactor c/binary_search header --- c/binary-search/src/binary_search.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/c/binary-search/src/binary_search.h b/c/binary-search/src/binary_search.h index 4a510b8..b763830 100644 --- 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