Question

When writing or using an algorithm, should the Big Oh complexity be mentioned?

Was it helpful?

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
scroll top