3 ms·
I remember reading the linked post on the Google blog. Ah, here it is: http://news.ycombinator.com/item?id=1130463 http://news.ycombinator.com/item?id=1130463 (
by Jach 17y ago
I remember reading the linked post on the Google blog. Ah, here it is: http://news.ycombinator.com/item?id=1130463 http://news.ycombinator.com/item?id=1130463 (Wow, that was only 60 days ago?)
Maybe that's why when I did this in C just now, my version ended up almost identical to the Java version. (Mine does the more correct "int middle = low + (high - low) / 2;", and I wasn't even thinking about the possibility of integer overflow the other way.) So yes, but only from benefit of having to have written it numerous times in school and in teaching newbies to use it.