Order for binary searches

Wayne E Baisley wbaisley@enspherics.com
Mon, 12 Nov 2001 21:01:36 -0600


> Let's ignore the contents.  Given t elements, how many samples
> does it take to arrive at n, where 0 <= n <= t?
> 
> Maybe that's clearer.. I had trouble describing this to someone
> else to-day; he kept telling me log2(t), also.. as in 'it will never
> take more than log2(t) tries to find a cell.'  Not what I want.

I think what you're asking for is ...

log2 (|t/2 - n|)

Cheers,
Wayne