3 ms·
Sure, but for something to be considered exponential running time it must be <some-constant>^n. So 2^n would be exponential. However, n^2 is instead quadratic.
by whycombagator 6y ago
Sure, but for something to be considered exponential running time it must be <some-constant>^n.
So 2^n would be exponential. However, n^2 is instead quadratic.
Quadratic time complexity is better than exponential.
Here is a useful comparison of the rate of growth for various time complexities[0]
[0] https://stackoverflow.com/a/34517541/3574076 https://stackoverflow.com/a/34517541/3574076
- dgb23 6y agoQuadratic in this specific case, or more generally: polynomial.