Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started