3 ms·
> In algorithm analysis, we would typically have n represent time (or some other cost). No, n is never time in any kind of algorithmic analysis. n is a functio
by Maxatar 1y ago
> In algorithm analysis, we would typically have n represent time (or some other cost).
No, n is never time in any kind of algorithmic analysis. n is a function of the size of the input and the output is some measure of the cost related to the input.
In O(n^2), the size of the input is n and the amount of time, or space, or some measure of the cost has an upper bound that is proportional to n^2.
- wavemode 1y ago> In O(n^2), the size of the input is n and the amount of time, or space, or some measure of the cost has an upper bound that is proportional to n^2. Yes, this is my point. In the article, they classify an O(n^2) startup as one which achieves n^2 results in n time, which is the opposite of how the notation is typically used.