Don't ask to ask, just ask | |
PerlMonks |
Re: Sorting data that don't fit in memoryby dws (Chancellor) |
on Jan 24, 2001 at 13:45 UTC ( [id://53922]=note: print w/replies, xml ) | Need Help?? |
Here's a pointer.
If you can't fit the data into virtual memory, you're going to have to make a multi-pass sort, with intermediate results stored on disk. One algorithm you might consider is the "Radix" sort, which is a multipass, order preserving sort that is well-suited for very data sets with fixed-sized keys, and has O(n) behavior. See Knuth, Vol. 1, Sorting and Searching for a complete description. As you read Knuth, consider how you'd use disk files for the intermediate partitions.
In Section
Seekers of Perl Wisdom
|
|