Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Right, an algorithm that always produces an answer right after the heat death of the universe is O(1).

Big-O is great for telling you which algorithms/datastructures won't scale, it can't tell you which are actually fast enough.



And in fact, some data structures that scale poorly will perform better on small sets of data.

For example, a simple list of pairs with linear lookup time can be faster than a hash table for small amounts of data, because it doesn't have to compute the hash.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: