3 ms·
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/datastru
by wongarsu 10y ago
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.
- wtetzner 10y agoAnd 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.