Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by ferrency (Deacon)
on Aug 03, 2000 at 00:55 UTC ( [id://25848]=note: print w/replies, xml ) Need Help??


in reply to Sorting a list of IP addresses (aka Why I hate Big O)

I think O() analysis definitely has its uses. It's good for determining "all else being equal, which algorithm will be faster?" It doesn't say anything about implementations. I'm pretty sure I could write a poor implementation of an O(n log n) algorithm that runs slower than a good implementation of an O(n^2) algorithm (for sufficiently small datasets. How small? Small enough so the O(n log n) implementation is slower :) But in general, the O(n log n) solution will be faster, as your data set increases in size, and as you tweak the "all else" in your implementation to get it as close to "equal" as possible.

I wasn't a huge fan of O() notation in college either, once we started analyzing the more complicated algorithms. Not because it was inaccurate, but because it was difficult, and "no one uses those algorithms anyway." However, now I'm glad I did it, because after doing all the hard analysis, the easy analysis which I do use regularly (though not explicitly) comes intuitively.

Alan

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://25848]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-28 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found