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

It's not wrong, they just overloaded the = operator for the RuntimeComplexity class ;-P

Jokes aside, in my college we would write something like:

O( f(n) ) = O(n^2) + O(n)



Anything using = for a relation that is not symmetric is cursed IMO. More generally, any relation using a symbol that is visually vertically symmetric should be symmetric.


If you use big O notation at both sides, as in my example, it becomes symmetric.

In the same way that ceiling(1.2) = ceiling(1.9) is symmetric, even if their contents are not equal.


Yeah, like centered ° for function composition is a pet peeve of mine...


> O( f(n) ) = O(n^2) + O(n)

Naively, one would assume that that implies O( f(n) ) - O(n) = O(n^2), which is not correct. However, O( f(n) ) = O(n^2) + O(n) implies O( f(n) ) = O(n^2), which would have been obvious if proper notation had been used.




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

Search: