|
Big O notation
Could somebody explain to me big o notation? I have some examples here:
a) for(j =0; j<=n, j+=2)
printf("Hello\n");
for (k=n-1; k>1; k-=3)
printf("Good Bye\n");
c) for(i=1; i<=n; i+=3)
for(j=i; i<= i+5; ++i)
sum++;
for(k=n; k>=0; --k)
printf("Result = %d\n", sum-k);
c) i = n
while (i>0)
{
pirntf("Fun Times\n'");
i/=2;
}
d)
i = 2;
while (i < n)
{
for (j=i; j> 0; --j)
printf(%d\n",i);
i++;
}
I have the answers, but I need an explanation on how to get them. Thanks.
|