# is this expression $O(n^2)$ or $O(n^3)$?

$$\sum_{i=0}^{n-1} (i+1)(n-1)$$

Is that $O(n^2)$ or $O(n^3)$? Can you clarify me just how you located it? Many thanks.

0
2019-12-02 03:10:03
Source Share

Hint : Factor out the (n - 1) and afterwards make use of that the ordinary term in the amount has dimension n/2.

0
2019-12-03 05:08:04
Source

Ok. so from what Noah Snyder claims, that will certainly be : $(n-1)\sum_{i=0}^{n-1} (i+1)$.

The internal summation is $O(n^2)$, and also the external variable is $O(n)$, so on the whole this has $O(n^3)$ intricacy, right?

0
2019-12-03 05:02:36
Source