0

Why is the big O of this function O(n^2)?

Isn't this just a sum of constant terms? Shouldn't the function be O(1)?

Raphael
  • 72,336
  • 29
  • 179
  • 389
Nicholas
  • 115
  • 7
  • Note that questions should be readable without the title, and you can use LaTeX mathematics here. Hint: Gaussian sum. Also, there no such thing as "the big O" of a functions; every function is in infinitely many "big Os". – Raphael May 21 '15 at 12:48
  • $\sum_{i=1}^n 4$ is also the sum of constant terms, but that sum is obviously $4n$ which is certainly not $O(1)$. The problem you have is that the sum depends on $n$ so can't possibly be constant. – Rick Decker May 21 '15 at 14:50

0 Answers0