Question: 2. Func7(n) 1 s0; 2 in; 3 while (1) do for j1 to i do 4 5 ss+i-j; 6 end 7 8 end iti-n;

2. Func7(n) 1 s0; 2 in; 3 while (1) do for j1to i do 4 5 ss+i-j; 6 end 7 8 end iti-n;

2. Func7(n) 1 s0; 2 in; 3 while (1) do for j1 to i do 4 5 ss+i-j; 6 end 7 8 end iti-n; 9 return (s); T(n) = i for in, n n, n 2n, ..., n-kn=0 = n + (n n) + (n 2n) + + (n-kn), where k = n/n = n.5 - - = kn-n (1+2++k)=(kn) = (n) Or, another way to do it: T(n) = i forin, n n, n 2n, ..., n kn = 0 = 0 + n +2 n + + n, where n = n.5 n =(1+2+3++n25)=n - (n) = (n )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Algorithms Questions!