ta ta tb tb ta ta tb tb sorting multiway merge if we have extra tapesthen we can expect to reduce the number of passes required to sort our input we do this by extending the basic (two-waymerge to -way merge merging two runs is done by winding each input tape to the beginning of each run then the smaller element is foundplaced on an output tapeand the appropriate input tape is advanced if there are input tapesthis strategy works the same waythe only difference being that it is slightly more complicated to find the smallest of the elements we can find the smallest of these elements by using priority queue to obtain the next element to write on the output tapewe perform deletemin operation the appropriate input tape is advancedand if the run on the input tape is not yet completedwe insert the new element into the priority queue using the same example as beforewe distribute the input onto the three tapes ta ta ta tb tb tb we then need two more passes of three-way merging to complete the sort ta ta ta tb tb tb