3 ms·
What are you getting at? That this is a trick or bad question? This is on the order of fizzbuzz +1 level maybe. It's elementary stuff. Or was he looking for b
by jiveturkey 7y ago
What are you getting at? That this is a trick or bad question?
This is on the order of fizzbuzz +1 level maybe. It's elementary stuff.
Or was he looking for best-case optimization or something more than just binary search.
- commandlinefan 7y agoIt seemed like a bit much to me at the time. It's not something that I've ever had occasion to actually use (I don't search sorted lists much...). I wondered if I would have been able to come up with it if I hadn't already seen it in data structures class years ago - I mean, of course I figured out the "algorithm" when I was a little kid playing "guess the number", but I'll never know if I would have come up with it in that context if I hadn't already seen it. The consensus here seems to be that it's a reasonable question, though - but I do remember that the only people who ever got it were people with CS degrees.