DEV Community

Discussion on: Algorithms in JavaScript with visual examples.

Collapse
 
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.

Collapse
 
swastikyadav profile image
Swastik Yadav

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