repeat runs copy(rw[ ]until eorinc( )inc( )if then : end until eofrepeat if then : else : endk : for : to - do (*set input riders*runs set( [ ] [ ]endfor : to - do (*set output riders* [ :files new("")files set( [ ] [ ] end(*merge from [ [ - to [ [ - ]*for : to - do [ : endl : (*nof runs merged* : repeat (*merge on run from inputs to [ ]*inc( ) : repeat (*select the minimal key* : min : [ [ ]firsti : while do : [ [ ]firstif min then min :xm : endinc(iendruns copy( [ [ ]] [ ])if [ [ ]eof then (*eliminate this sequence*dec( )dec( ) [ : [ ] [ : [ elsif [ [ ]eor then (*close run*dec( )tx : [ ] [ : [ ] [ :tx end until inc( )if then : end until until return [ end balancedmerge polyphase sort we have now discussed the necessary techniques and have acquired the proper background to investigate and program yet another sorting algorithm whose performance is superior to the balanced sort we have seen that balanced merging eliminates the pure copying operations necessary when the distribution and the merging operations are united into single phase the question arises whether or not the given sequences could be processed even more efficiently this is indeed the casethe key to this next improvement lies in abandoning the rigid notion of strict passesi to use the sequences in more sophisticated way than by always having sources and as many destinations and exchanging sources and