Pet peeve: "X is more efficient than Y because it had a smaller Big O".
Big O and friends measure *algorithmic* efficiency, which may not correlate to the kind of efficiency you actually want.
E.g. iterating over a linked list vs array: both O(n), one *way* slower in practice.
Big O and friends measure *algorithmic* efficiency, which may not correlate to the kind of efficiency you actually want.
E.g. iterating over a linked list vs array: both O(n), one *way* slower in practice.
And "this algorithm is O(n), but this other is O(log(n))" doesn't matter if your greatest value of n is like 12.
Better metric: Big OH NO
Are the algorithmic complexity, ethical considerations, cache behaviour, data fit, or implementation & maintenance burden of this algorithm going to cause me to look back and say OH NO? Maybe choose another option.
Are the algorithmic complexity, ethical considerations, cache behaviour, data fit, or implementation & maintenance burden of this algorithm going to cause me to look back and say OH NO? Maybe choose another option.