C: binary search

This commit is contained in:
2021-08-20 01:02:07 +02:00
parent 01365f370b
commit 01fcdc8566
5 changed files with 220 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#ifndef BINARY_SEARCH_H
#define BINARY_SEARCH_H
#include <stddef.h>
const int *binary_search(int value, const int *arr, size_t length);
/* See GNUmakefile below for explanation
* https://github.com/braoult/exercism/blob/master/c/templates/GNUmakefile
*/
#if defined UNIT_TEST || defined DEBUG
#include <stdio.h>
#include <stdlib.h>
#endif
#ifdef TESTALL
#undef TEST_IGNORE
#define TEST_IGNORE() {}
#endif
#endif