DEV Community

Discussion on: Algorithms in JavaScript with visual examples.

ggenellina profile image
Gabriel Genellina

You got the O(n^2) complexity wrong. O(n^2) is quadratic complexity, a special case of polynomial complexity O(n^k).
Exponential complexity is O(2^n) and none of your example algorithms have exponential complexity.

swastikyadav profile image
Swastik Yadav Author

Yes, you are right. Thaks for this. I will fix it soon.