3 ms·
The use of that notation implies the number of classes was proportional to number of operations (+/- constant factor), not that it was equal to number of operat
by TeMPOraL 8y ago
The use of that notation implies the number of classes was proportional to number of operations (+/- constant factor), not that it was equal to number of operations. O(n) works both if there's 1 class per operation, and if there's 5 classes per operation.
- twtw 8y agoOk. O(n) also through a away a lot of useful information. It seems simpler in every sense to just say "several classes for every operation."
- TeMPOraL 8y agoAgain, you're absolutely right wrt. proper, formal usage. But big-O is also a part of programmer slang now. The OP used it in this form. (It's also faster to write, or even say out loud, "O(n)", than it is to write/say "proportional to number of").
- deleted 8y ago[deleted]
- derefr 8y agoFrequently when writing O(n), the writer is making a comparison. e.g. "The GC was O(n log n) wrt memory, but now it's just O(log n)." That expands to a lot more text. Or, to put that another way: there is a constant cost in human parsing complexity when writing "O(n)", but the number of parse-nodes in the text when using "O(n)" only increases as O(n), whereas without "O(n)", it increases with O(n^1.3). ;)