Algorithms (big-Oh)

This is a discussion on Algorithms (big-Oh) within the C Programming forums, part of the General Programming Boards category; I have absolutely no clue as to how it works, but i cant seem to find any resources to learn ...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    13

    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
    Posts
    3,211
    http://en.wikipedia.org/wiki/Big_O_notation

    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
    Posts
    14,185
    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
    Posts
    5,006
    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, 02:33 PM
  2. How Big is Too Big
    By kpreston in forum C Programming
    Replies: 4
    Last Post: 10-25-2008, 11:16 AM
  3. Big and little endian
    By Cactus_Hugger in forum C Programming
    Replies: 4
    Last Post: 10-12-2005, 08:07 PM
  4. relative strength of encryption algorithms (blowfish, des, rinjdael...)
    By duck-billed platypus in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 12-30-2001, 04:20 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21