Hacker News new | ask | show | jobs
by thaumasiotes 2378 days ago
> If this ("turn it into two not nested loops") was indeed intended, I'd suggest to spell it out, not abuse notation

O(2n) is not an abuse of notation. It's just as well defined as O(n). The fact that O(2n) is a subset of O(n) is a theorem, not part of the definition of the notation.

1 comments

It's a subset, but also a superset.
Yes? But to replace O(2n) with O(n), you only need that it's a subset.
You have your point.