Subj : Re: Sorting To : borland.public.cpp.borlandcpp From : "Ed Mulroy [TeamB]" Date : Wed Dec 17 2003 01:34 pm You indicated that you are using BC++ 5.01 but did not mention if you are writing for DOS, for 16 bit Windows 3.1x or for 32 bit Windows (Win32). I had to do that a long time ago with a 17 Meg file (supplied on an array of 50, 360K floppy disks!) on a machine that had 128K (not Meg) of memory. You do not need a lot of memory to do such a sort. There was a single file that had a massive amount of strings. The sorting went like this: open the original file while not end of file on the original file create a new temp1 file read some strings from the file use qsort to sort them write them to the temp1 file close the original file while more than one temp file is left while there are temp1 files left open two temp1 files merge their contents into a new temp2 file delete the two temp1 files close the file that was used as output If a temp1 file is left open a temp2 file merge the contents with the temp2 file into a new temp2 file delete the temp1 file delete the temp2 file that was used as input close the file that was used as output while more than two temp2 files are left open two temp2 files merge the contents into a new temp1 file delete the temp2 files close the file that was used as output if a temp2 file is left open a temp1 file merge the contents with the temp2 file into a new temp1 file delete the temp2 file delete the temp1 file that was used as input close the file that was used as output rename the one remaining temporary file to the output file name That looks like a lot until you realize that you need only one function to do the sort and one function which is used for all the merges. Except for the user interface, the source code might be less than 6K. .. Ed > Nokomis wrote in message > news:3FE07E01.EDE85954@radiolink.net... > > Anyone know an algorithm for sorting large numbers of > character strings? > > Something like a telephone direcctory - too big for a normal > array. (5.01) .