26 October 2015

Big-Oh: Constant vs Logarithmic

- Do you know what is quickest ever method to lookup string?

- Mmmm. Apparently hash table.

- Nope. Dude, its well known that binary search is quicker!

- ?!

Kind of similar to that was a conversation with one guy. (Cheers, Noel!) No doubt, to put it mildly, it sounds crazy: method with logarithmic asymptotic complexity outperform constant one. But it is only on first look. The devil is hiding in details, as always...