I've always said that if someone asked me to code up the binary search algorithm as part of an interview, I'd bonk them on the nose. Why? Why get so upset over an obvious algorithm that anyone can explain? Because there are always bugs: Official Google Research Blog: Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken
Now a whole new class of bugs: integer overflow.
Hmm. Now I'm almost hoping someone does ask me to code up a binary search at my next interview, just so that I can do a safe mid-point calculation and see them contemplate whether or not to ask me why in the world the line is coded that way.
email: Eric_Richards at ericri dot com
Lots More About Eric.
Disclaimer: The postings (and comments) here represent personal point of views and in no way represent the point of view or official opinions of my employer (Microsoft Corporation). The postings here are provided "AS IS" with no warranties, and confers no rights. And if you're reading this blog, you're not only incredibly discerning, you're also knee-weakening good looking.
More blogs about Eric Richards.