Abstract

Most traditional merging and merging-based sorting algorithms are based on 2 sorters or 2 comparators. A new merging technique is developed, namely sloping-and-shaking multiway merging, and a corresponding multiway sorting method based only onk-sorters is proposed. The sloping-and-shaking merging algorithm mergesk sorted lists into one, wherek can be any prime number. The merging process is not a series of recursive applications of 2-way merging. It sorts the keys on them×k plane in vertical and horizontal directions, then along sloping lines with various slope rates step by step. Onlyk-sorters are needed in the merging or sorting process. The time needed to mergek sorted lists, withm of each, is (k+┌log2(m/k)┐)tk, and the time for sortingN keys is (1+(p−1)k+1/2(p−1)(p−2)┌log2k┐)tk, wherep=logkN, andtk is the time to sortk keys. The proposed algorithms can be implemented either by hardwared sorting networks, or on general purpose parallel and vector machines. The traditional odd-even merging can be viewed as a special case of the multiway merging proposed (whenk is 2). While theoretically the proposed algorithms provide a new understanding of parallel merging and sorting processes, they may be used in practice to construct sorting circuits faster than 2-sorter based sorting methods.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call