Thread: Big O notation
View Single Post
Old 06-21-2004, 05:28 PM   #1 (permalink)
saiz66
Registered User
 
Join Date: May 2004
Posts: 11
saiz66 is on a distinguished road
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.
saiz66 is offline   Reply With Quote