Hacker News new | ask | show | jobs
by tomc1985 2217 days ago
Huh? n-squared is an exponent
4 comments

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

Quadratic in this specific case, or more generally: polynomial.
Exponential refers to c^N. N^c is quadratic. Small visualization: https://www.onlinemathlearning.com/image-files/exponential-q...
We call that polynomial, not quadratic.
Both is right, quadratic being subset of polynomial.
It doesn't help that most people in journalism use the phrase exponential growth to describe quadratic growth.
we call that "quadratic". exponential is when the exponent is variable. (unless I'm being whooshed)
No, you're 100% correct.

O(n^[number]) = polynomial, with O(n^2) being quadratic.

O([a number]^n) = exponential.

I guess the authors aren't big on CS fundamentals?

Indeed. It's been a while since I've had to so much as think about big O notation and I forgot that quirk. To most folks "exponential" means n^2 or greater
Most folks are using the word wrong then.
“Superlinear” is the word you’re looking for.
Superlinear can mean O(n log n) or anything like that, which is smaller than O(n^2).
n^0 is also an exponent. Do you consider constant time to be exponential growth?
When family talks to me about covid spreading exponentially I am pretty sure they mean n times n, or n^2

Yes we all know the technical definitions with respect to software and algorithmic complexity. But the lack of sympathy/empathy on display with how a common definition of a word can be misconstrued by someone without an academic background in tech is kind of surprising (ok well maybe not so surprising but c'mon folks, we are all human)

disease spread when modeled is actually exponential.

https://en.wikipedia.org/wiki/Basic_reproduction_number#Esti...