Order for binary searches

Rodent of Unusual Size Ken.Coar@Golux.Com
Mon, 12 Nov 2001 21:52:31 -0500


Jeff Barr wrote:
> 
> Isn't this really the same as a binary search, changing only
> the fact that the terminal condition is:
> 
>         (cell[n] == 1 && cell[n+1] == 0)
> 
> ?
> 
> The value being searched for just happens to span two cells.
> There is exactly one place where the cells stop being 1's
> and start being 0's, right? The array is always:
> 
>         1 ..... 1 0 ...... 0
> 
> So this is just a standard binary search, complexity-wise.

Very good; that's exactly right.  I'm reassured that I haven't
completely lost my ability to communicate! :-)

BUT.. I know what it is, but not the mathematical expression
that answers my question. :-/
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"