0

What is the clear interpretation of this?

    O(1)+O(2)+O(3)+O(4)+O(5).......O(n)

And how different is this from

     sigma O(i) 1<=i<=n?

CLRS says it is different but does not explain how are these different?

silentseeker
  • 416
  • 5
  • 14

1 Answers1

0

If I remember correctly, the asymptotic complexity is always expressed with the highest order function, so

O(1)+O(2)+...+O(n)

is just

O(n)

Which makes sense if n is reasonably large. If n is small the whole complexity stuff makes little sense anyway.

helb
  • 7,609
  • 8
  • 36
  • 58