摘要 |
PROBLEM TO BE SOLVED: To achieve sort that is fast and constant in processing time and uses little memory.SOLUTION: Processing to merge two sorted data strings obtained by merge sort to recursively perform rearrangement of two pieces of data, four pieces of data, ..., N pieces of data for N pieces of data is performed by block swap merge (S104), and sort is performed for a second data string (S105). The block swap merge compares the magnitude of mth data in a first data string with the magnitude of first data in a second data string regarding n first data strings and n adjacent second data strings, where n=1, 2, ..., N/2, and when the first data in the second data string is smaller, swaps {n-(m-1)} pieces of data after mth in the first data string with {n-(m-1)} pieces of data after the first in the second data string from m=1 to m=n.SELECTED DRAWING: Figure 8 |