|
|
| Don't ask to ask, just ask | |
| PerlMonks |
RE: Sorting a list of IP addresses (aka Why I hate Big O)by DrManhattan (Chaplain) |
| on Aug 03, 2000 at 16:25 UTC ( #25958=note: print w/ replies, xml ) | Need Help?? |
|
Read further down in the Guttman/Rosler paper to where they discuss the "packed-default" sort:
The idea is to pack the entire list once before sorting it then get each address back out with a substr afterwards. Using this technique, you only make N packs and N substrs, instead of N*log(N) packs. It also has the advantage of using sort without calling a subroutine for each comparison which is a huge speedup. -Matt
In Section
Meditations
|
|
||||||||||||||||||||