Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-21-2004, 04: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
Old 06-22-2004, 09:19 AM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,161
Belisarius is on a distinguished road
I took some algorithm classes, but never really memorized Big-O, but here is a link that might help.
__________________
GitS
Belisarius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming Conventions and Hungarian Notation RobertStout Standard C, C++ 2 10-17-2004 11:32 AM
SCO suits target two big Linux users redhead Code Newbie News 2 03-04-2004 03:04 PM
Longhorn 'Big Bet' For Company redhead Code Newbie News 1 07-24-2003 04:11 PM
the big 5-0-0 saline Lounge 7 03-27-2003 07:50 PM
The Big 300! Ilya020 Lounge 7 03-02-2003 09:41 AM


All times are GMT -8. The time now is 09:38 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting