int *bsearch( int value, int *array, int size ) { assert( size >= 0 ); if ( size == 0 ) return NULL; if ( size == 1 ) return *array == value ? array : NULL; int half = ( size + 1 ) / 2; return array[ half - 1 ] < value ? bsearch( value, array + half, size - half ) : bsearch( value, array, half ); }