Lists of size Integer.MAX_VALUE

R

Roedy Green

Right, but these cases aren't applicable to Bloch's updated
binary search code. The original (lo + hi) / 2 code was
definitely a flaw, but I don't think it's fair to say that
his updated ones are flawed since they work exactly as claimed.

It is flawed in that the algorithms do not do what is advertised "set
m to the average of l and u, truncated down to the nearest integer".
It is not flawed because in the context of a binary search, the bugs
don't hurt it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,203
Latest member
KaliShumat

Latest Threads

Top