Question: Q 5 : Find the complexity ( Exact and approximate ) for the basic operations of the following algorithms: sum - ; for ( k

Q5: Find the complexity (Exact and approximate) for the basic operations of the following
algorithms:
sum -;
for (k-1;kc-n;k**-2)
for (j-1;j-n;++j)
sum+t;
sun2-;
for (k-1;k-n;k**-2)
for (j-1;j-k;++j)
sun 2++;
int Fun2(int n)
{
if (n-e)
return 1;
for (int j-;j-i;j++nmn-lonn(n-1,n+1,0)(n-1,n,0+1)i=1;i-n;i**-2O(n5)T(n)T(n)=2T(n2)+aT(1)=babT(n)=(nlogn)slarr0
for ilarr1tondo
BS+i**i
Return Si-;i
for(intj-;j-i;j++)
constoperation;
return 1* Fun3(n2);
 Q5: Find the complexity (Exact and approximate) for the basic operations

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 Databases Questions!