Subj : Re: Sorting To : borland.public.cpp.borlandcpp From : "Ed Mulroy [TeamB]" Date : Thu Dec 18 2003 05:38 am I agree. These days large hard drives, fast processors and large memory are common and an N-way merge is more attractive than the 2-way merge that I described. > Scott wrote in message > news:3fe12cfb.9228324@newsgroups.borland.com... > ... > I used an N-way merge based on the idea that it would > avoid a lot of unneccesary I/O. N-way merging is just > an extension of the basic merge technique that Ed > Mulroy described, merging from many files instead of just > two. The number of input files may be limited by your > OS, which is why it's an iterative process. If you have more > temp files than available file handles, you generate another > temp file and re-do the merge process. Eventually you'll > have fewer temp files than available handles, at which point > you can generate your final output. .