Pink Poogle Toy Forum

The official community of Pink Poogle Toy. Bear with me while I tweak everything
It is currently Wed Sep 16, 2026 7:30 am

All times are UTC




Post new topic  This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Big Oh Notation
PostPosted: Mon Sep 20, 2004 4:01 pm 
Newbie
Newbie
Offline

Posts: 2
Joined: Tue Sep 21, 2004 6:07 am
I was just about going crazy over my Data Structures and Algorithms homework when I thought mebby I should pay a visit to good old PPT and see if y'all could help me. Guess it's been awhile, since my username didn't exist anymore! Anyhow, we're learning about Big Oh notation, which I should know by now, since I learned about it for the first time three semesters ago. But, I just don't get it. Think any of you could help me on the basics? I know the Big Oh for searches, etc, like a linear search takes O(n), and a binary search takes O(log n), but how do you decide what Big Oh is for a regular snippet of code? It's so confusing!

Thanks, m'dears!


Top
 
   
 Post subject:
PostPosted: Mon Sep 20, 2004 9:35 pm 
PPT Student
PPT Student
Offline

Posts: 388
Joined: Mon May 31, 2004 7:11 pm
ICQ: 42150172
When you go through say a for-loop. Go through the loop and figure out what exactly is going on inside, and then determine in your head how many times the index will iterate through the loop.

If you have a nested for-loop iterating the same number of times, the Big-Oh notation would be O(n^2). The loop inside the outer for-loop needs to finish completely before the outer for-loop iterates to the next index.

_________________
Image
Image
Image


Top
 
   
 Post subject:
PostPosted: Tue Sep 21, 2004 7:26 pm 
Newbie
Newbie
Offline

Posts: 2
Joined: Tue Sep 21, 2004 6:07 am
Thanks, that helped a bit, and another comp sci major told me about a book that will help, too! :-)


Top
 
   
Display posts from previous:  Sort by  
Post new topic  This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited