- #1
EvLer
- 458
- 0
Hi everyone,
I have the following recurrence to represent in terms of n:
Basically, it is an analysis of following code:
So, I came up with summations but not sure how to switch to n.
So far I have following:
Second part resulted in c1[n(n-1) - [n(n+1)]/2 - (n-1)]; but I am stuck on the first part. Should I regard j = i + 1 as some constant?
Thanks a lot.
I have the following recurrence to represent in terms of n:
Code:
n-1 n j
Sigma Sigma Sigma(c1) =...
i =1 j = i+1 k=1
Code:
for(i = 1 to n -1)
for(j = i+1 to n)
for(k = 1 to j)
something of O(1)
So far I have following:
Code:
n-1 n n-1 n n-1 n
Sigma Sigma (c1)(j-1) = c1 Sigma Sigma j - c1 Sigma Sigma 1;
i=1 j=i+1 i=1 j=i+1 i=1 j=i+1
Thanks a lot.
Last edited: