Thread: Algorithms (big-Oh)

  1. #1
    Registered User
    Join Date
    Apr 2007

    Algorithms (big-Oh)

    I have absolutely no clue as to how it works, but i cant seem to find any resources to learn basics about O(log n) O(n) etc.. etc...

    Anybody care to help ?

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007

    The basic idea is... "How many operations do you need, in terms of n, in order to complete the algorithm?"

    That is pretty much what it is. If you're going through an array linearly for something, then you have to go through all elements. If there are n elements, you require n operations -- or accesses of data. Thus you could say it is O(n).

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Your wikipedia/google skills need work, then. (Granted, the Wikipedia article is rather formal and mathematical and stuff.)

    ETA: And, for that matter, just about every algorithms book is going to not only explain what the notation means, but how to figure it out for some actual algorithms.

  4. #4
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting algorithms, worst-case input
    By Leftos in forum C++ Programming
    Replies: 17
    Last Post: 06-15-2009, 01:33 PM
  2. How Big is Too Big
    By kpreston in forum C Programming
    Replies: 4
    Last Post: 10-25-2008, 10:16 AM
  3. Big and little endian
    By Cactus_Hugger in forum C Programming
    Replies: 4
    Last Post: 10-12-2005, 07:07 PM
  4. relative strength of encryption algorithms (blowfish, des, rinjdael...)
    By duck-billed platypus in forum A Brief History of
    Replies: 3
    Last Post: 12-30-2001, 04:20 PM