At 10:49 PM 9/23/98 +0200, Daniel GAUDRY wrote:
I need a good polyphase merge sort for VERY large disk files.
I read about it in quite a few programming books but they never go to the
end (no source code) and stay clear of doing so!!!!!, however it is what
I need.Is there somebody who has one or knows where I can find it.
Hmmm. First, I don't think that a polyphase merge sort is what you
want when working from disks, since they are usually treated as random
access devices. A carefully implemented heap sort may result in the
fewest disk reads. Or it may be that a key sort is the way to go. (Read
all the keys into memory, with a pointer into the file to the record.
Sort the keys, then write the sorted file in order.)
But the real answer is to use the Cobol sort command, interfacing via
the Annex B stuff, and let the sort library provided with the Cobol
implementation do its stuff. These sort libraries are very complex, and
do take into account the amount of disk and main memory available when
the sort is called.
Robert I. Eachus
function Message (Text: in Clever_Ideas) return Better_Ideas is...