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?
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?
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.