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?
This is a discussion on Big O Notation within the C++ Programming forums, part of the General Programming Boards category; What would be a code example for this Big O Notation? 2n^2 * 2^n + logn = O(N^2*2^N) Where do ...
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?
[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
or for the O notationCode:for i = 1 to 2*n^2 for j = 1 to 2^n print "hello" for i = 1 to log n print "hello"
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