Thread: Big O Notation

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    Big O Notation

    What would be a code example for this Big O Notation?

    2n^2 * 2^n + logn = O(N^2*2^N)

    Where do the constants come from in the code?
    Is there a good web site that has programming examples of big O notation and efficiency?

  2. #2
    Blank
    Join Date
    Aug 2001
    Posts
    1,034
    [qoute]
    What would be a code example for this Big O Notation?
    2n^2 * 2^n + logn = O(N^2*2^N)
    [/quote]

    in puedo code
    Code:
    for i = 1 to  2*n^2 
          for j = 1 to 2^n 
                 print "hello"
    for i = 1 to log n
          print "hello"
    or for the O notation
    for i = 1 to N^2*2^N
    print "hello"

    You could do something similar to this. It's your choice
    if you want to subsitute for i = 1 to n^2 with some more
    meaningfull such as bubble sort.

    Here's a link from google you can probably find more.
    http://www.cs.ncat.edu/faculty/dichev/BigOh.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. big O notation question
    By l2u in forum C++ Programming
    Replies: 7
    Last Post: 11-08-2008, 03:53 PM
  2. Big Oh Notation problem
    By vaibhav in forum C++ Programming
    Replies: 4
    Last Post: 04-01-2006, 09:02 AM
  3. about big O notation
    By deepakkrmehta in forum C Programming
    Replies: 3
    Last Post: 08-27-2005, 02:31 PM
  4. Big Oh notation, help me notate this
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 05-12-2005, 03:27 PM
  5. big o notation
    By heat511 in forum C++ Programming
    Replies: 5
    Last Post: 04-19-2002, 11:27 AM