For the below code :
foo()
{
for(i=1;i<=n;i++)
{
for(j=0;j<i;j++)
{
for(k=0;k<j;k++)
c++;
}
}
}
Here k is executing j-1 times j is executing i times and i is executing n^2 times, so first I am doing summation from
k=0 to k=j-1 over k , I am getting Order j^2, Now j is summed up from 0 to i, so I am getting order of i^3 , Now when I am doing summation of i from i=1 to n^2 , I am getting order of n^8 . But this is getting too large, I checked with an example, it is not matching,So please correct where I went wrong.