Ask your own question, for FREE!
Mathematics 86 Online
OpenStudy (anonymous):

Bubble Sort is known to be an O(N2)) algorithm. If a program using this sort completes in .001 seconds when N = 100, what will be the likely execution time in seconds when N equals each of the following values? N = 1000 •N = 10,000 •N = 100,000 •N = 1,000,000 How do I figure this out?

OpenStudy (anonymous):

Yay, algorithmic analysis! I love this! Since Bubble Sort is an \(O(n^2\) algorithm, we know that its running time will be proportional to its input value. Thus, because when \(N = 100\), the running time is .001, it must be that \(T_r(n) = (\log n)^{-1}\). In other words, it completes in .01 seconds when N = 1000, so on. I may have misread the question

OpenStudy (anonymous):

Okay how would you know to use log... and then why would you know to use that... I'm sorry im very confused when it comes to big oh notations

OpenStudy (anonymous):

It's actually just a very painful way of saying the zeros shift. .001 is 10^(-3), and when N = 10^3, 10^(-3) is the running time. .01 is 10^(-2) and when N = 10^4, 10^(-2) is the running time. So on.

OpenStudy (anonymous):

Okay and the log equations is basically how it shifts... but how would one deduce that from the original problem.. how would I know to use log or even set my equation up that way... does log anything reduce numbers 10 fold?

OpenStudy (anonymous):

Well, log isn't commonly used when describing this sort of thing, but I certainly find it convenient. When I say log, I am referring to the common logarithm (log base 10). When we take log(100), it returns 2, because 10^2 = 100.

OpenStudy (anonymous):

okay thank you this helps a lot.. I wouldn't want to be a bother but do you mind explaining these terms O(f(N)), ƒÇ(f(N)), ƒÁ(h(N)) , and o(f(N))

OpenStudy (anonymous):

I can't see your post properly, OpenStudy's formatting is broken right now. However, I believe you are asking for explanations of theta, omega, big-oh, and little o notation?

OpenStudy (anonymous):

Yeah let me repost that

OpenStudy (anonymous):

ohh it still shows up the same

OpenStudy (anonymous):

Yes that's what im referring too

OpenStudy (anonymous):

I think that a few documents I watched a while back will help you more than I can. This guy at Berkeley is awesome. http://www.youtube.com/watch?v=VIS4YDpuP98

OpenStudy (anonymous):

Thanks!!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Gucchi: leadership help
13 minutes ago 11 Replies 2 Medals
Arizona: HELLLp science ASAP
19 minutes ago 7 Replies 0 Medals
Gucchi: leadership help
50 minutes ago 10 Replies 2 Medals
Limitless2: what is circumference of a circle
1 hour ago 12 Replies 3 Medals
kenziegray7965liner: pls help
59 minutes ago 8 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!