Should one write Big Oh complexity in the documentation of algorithms? [closed]
https://softwareengineering.stackexchange.com/questions/2086
-
16-10-2019 - |
Question
When writing or using an algorithm, should the Big Oh complexity be mentioned?
Solution
If you can back it up with real analysis, then yes, absolutely.
@Casebash test != analysis. If it should always be documented then just start throwing
// this algorithm is O(n!)
on every function.
I've worked with people who would say things like 'This function is O(1) because there are no loops', and then I would point to the call $(someHugeList).each(function(//...
Licensed under: CC-BY-SA with attribution
Not affiliated with softwareengineering.stackexchange