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.
Writing about Full-Stack web development 👨🏻💻 and design || Join me to be a better full-stack developer in 10 minutes a week || Newsletter: https://www.getrevue.co/profile/8020lessons
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.
Yes, you are right. Thaks for this. I will fix it soon.