Run Time Analysis QUESTION
Example Below:
Sum = 0;
for(i=1 to (n-1)
for(j=1 to (i-1)
Sum = Sum + i*j;
I am trying to find the total.
So far i have...
Line 1 = 1
Line 2 = n or is it n-1?
Line 3 =
Line 4 =
Total = 1 + n +...+...
here is what i think the answer for line 3 should be? 'n' OR 2n OR n*n ???
Topic archived. No new replies allowed.