No such thing as a small change PerlMonks

### RE: RE: Sorting a list of IP addresses (aka Why I hate Big O)

by young perlhopper (Scribe)
 on Aug 03, 2000 at 02:58 UTC ( #25875=note: print w/replies, xml ) Need Help??

Yes, i will jump in with you, enthusiastically. Thank you for the cogent explanation.

However, I wouldn't necessarily say the big O notation is a measure of the rate of change. (it is, sort of, but i don't think that's the best way to think of it).

Another way of thinking of it is this: Take two algorithms, algorithm A, which is O(N*log N), and algorithm B, which is O(N^2). Now let's say that the execution time for Algorithm A is 100 seconds when N=1000, and that the execution time for Algorithm B is 1 second when N=1000. At first glance, B might appear faster than A, and it certainly is for N=1000. However, what Big O tells us is that no matter what execution times we measure for A and B at a given value of N, A will be faster than B for some arbitrarily large N.

This, is essentially what the theorem behind big O states: That an algorithm with a 'smaller' big O will run faster than an algorithm with a 'larger' big O, for all N > X, X finite but arbitrarily large.

B may run 10^100 times faster than A for N = 10^1000, but since A has a 'smaller' big O, there is some N such that A will run faster than B.

Okay, i'll stop rambling.
-Mark

• Comment on RE: RE: Sorting a list of IP addresses (aka Why I hate Big O)

Create A New User
Node Status?
node history
Node Type: note [id://25875]
help
Chatterbox?
 Discipulus gired: adj the work position that stands between hired and fired.. LanX recommends inner immigration, work less hard and enjoy pay roll [MidLifeXis]: ahh, yeah, didn't look through nodes yet today. [erix]: haha [MidLifeXis]: Ahh well, time to get back to it, so there isn't a reason to take that choice out of my hands :-)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2017-03-23 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
Should Pluto Get Its Planethood Back?

Results (286 votes). Check out past polls.