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

It is quite sad that a paid content like one from Pluralsight could provide a very bad advices on how to measure performance or how to use one or another language feature.

Spoiler: the benchmarking code had quadratic complexity instead of linear. Yes, in the course on performance.



> It seems that the complexity is O(N^2) rather than O(2*N^2) as I expected. This is interesting! Obviously, my understanding of LINQ was incorrect.

Perhaps just a wording problem, but big-O notation doesn't care about constant factors.


What the author means is that they thought that the complexity was O(n^2) for two different reasons, but it turned out that only one of those reasons was valid. But abusing big-O notation is not a good way to express that.


Not only does it not care, it’s literally by definition that those two are identical


In practice though the factor of two can be relevant


The author explicitly stated O(2*N^2) is the same as O(N^2), but maybe that was a later edit?


Yeah it's edited, but still miscommunicating--this section should drop the big-O if it want to talk about constant factors.




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

Search: