4 ms·
Are you saying they should be able to derive a little known algorithm by themselves? What do you make of Knuth's quote about how many people implement binary s
by dockd 14y ago
Are you saying they should be able to derive a little known algorithm by themselves?
What do you make of Knuth's quote about how many people implement binary search wrong?
http://en.wikipedia.org/wiki/Binary_Search#Implementation_issues http://en.wikipedia.org/wiki/Binary_Search#Implementation_is...
- jrockway 14y agoMany people implement it wrong. The best programmers know how to check their work, and will be asked during the interview to check. Who doesn't know that (x + y) / 2 can overflow? But the people who you really want to filter out have no idea or intuition that a problem can be solved by slicing it into two. That's the key idea behind binary search (and indeed, much of computer science).