JP3534471B2 - Merge sort method and merge sort device - Google Patents
Merge sort method and merge sort deviceInfo
- Publication number
- JP3534471B2 JP3534471B2 JP2801395A JP2801395A JP3534471B2 JP 3534471 B2 JP3534471 B2 JP 3534471B2 JP 2801395 A JP2801395 A JP 2801395A JP 2801395 A JP2801395 A JP 2801395A JP 3534471 B2 JP3534471 B2 JP 3534471B2
- Authority
- JP
- Japan
- Prior art keywords
- sort
- data
- merge
- record
- sorted
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明はマージソート方法および
マージソート装置の改良に関する。データベースを作成
する場合にデータを昇順または降順に並べるとか、その
データベースに新たなデータが追加された場合に並べ替
えの必要性が生じた場合などにおいて、データのソート
(整列)処理が実施される。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to improvements in a merge sort method and merge sort device. When the database is created, the data is sorted in ascending or descending order, or when new data is added to the database and it becomes necessary to sort the data, the data is sorted. .
【0002】そのソート方法の1つとして、データ列の
各データを交互に振り分けた後、それぞれソートしつつ
併合(マージ)していくマージソート方法が広く採用さ
れているが、データ量が多いとソート処理に時間がかか
る。As one of the sorting methods, a merge sort method is widely adopted in which each data in a data string is alternately distributed and then sorted and merged (merged), but when the data amount is large. Sorting takes time.
【0003】近年では、端末装置においても、業務処理
上のデータ検索時間の短縮が要望されているため、ソー
ト処理頻度が増加しつつあり、ソート処理の高速化が要
望されている。In recent years, even in terminal devices, there is a demand for shortening the data search time for business processing, so the frequency of sort processing is increasing, and there is a demand for speeding up sort processing.
【0004】[0004]
【従来の技術】図8は従来例のマージソート方法説明図
である。図8は、マージソート方法の1例を示したもの
で、例えば、レコードNOが0〜7までの8データをデ
ータの大きさの順(昇順)に並べ替える場合、先ず、レ
コードNO=0のデータとレコードNO=1のデータを
振り分けた後、併合(マージ)する。この併合の際、デ
ータの大きさの順に並べる。この結果図のに示すデー
タ列が得られる。2. Description of the Related Art FIG. 8 is an explanatory view of a conventional merge sort method. FIG. 8 shows an example of the merge sort method. For example, when 8 pieces of data having record numbers 0 to 7 are rearranged in the order of data size (ascending order), first, record number 0 After allocating the data and the data of record NO = 1, they are merged. At the time of this merge, it is arranged in the order of the size of the data. As a result, the data string shown in is obtained.
【0005】続いて、レコードNO=2のデータとレコ
ードNO=3のデータを振り分けた後マージすると、
のデータ列が得られる。このようにして、それぞれ2組
のデータがソートされたデータ列,,,が得ら
れる。Subsequently, when the data of record No. = 2 and the data of record No. = 3 are sorted and merged,
The data string of is obtained. In this way, a data string in which two sets of data are sorted is obtained.
【0006】次のステップでデータ列とデータ列と
をマージすると、データ列が得られ、同様にしてデー
タ列,からデータ列が得られ、このデータ列と
とをマージすると1つのデータ列が得られる。この
データ列が、目的とする昇順にソートされたデータ列
となる。In the next step, a data string is obtained by merging a data string and a data string. Similarly, a data string is obtained from a data string, and a data string is obtained by merging with this data string. To be This data string becomes the target data string sorted in ascending order.
【0007】なお、マージする場合の処理は、例えばデ
ータ列とデータ列とを例にとると次の通りである。
先ず、データ列の先頭(0002)とデータ列の先
頭(0001)とを比較する。(0001)の方が小さ
いから、このデータをバッファに格納する。次にデータ
列の(0002)とデータ列の(0006)とを比
較する。(0002)の方が小さいから、(0002)
をバッファ内の(0001)の次に格納する。次はデー
タ列の(0005)とデータ列の(0006)と比
較する。(0005)の方が小さいから、(0005)
をバッファの(0002)の次に格納する。ここで残り
の比較データがないから、(0006)を最後に格納す
る。The processing for merging is as follows, taking a data string and a data string as an example.
First, the head (0002) of the data string and the head (0001) of the data string are compared. Since (0001) is smaller, this data is stored in the buffer. Next, the data string (0002) is compared with the data string (0006). (0002) is smaller, so (0002)
Is stored next to (0001) in the buffer. Next, the data string (0005) is compared with the data string (0006). (0005) is smaller, so (0005)
Is stored next to (0002) in the buffer. Here, since there is no remaining comparison data, (0006) is stored at the end.
【0008】このように、2組のデータ列を整列済みの
並びごとに併合する手続きを繰り返すことにより、昇順
に整列された1つのデータ列が得られる。As described above, by repeating the procedure of merging two sets of data strings for each of the arranged sequences, one data sequence arranged in ascending order can be obtained.
【0009】[0009]
【発明が解決しようとする課題】端末装置における業務
処理等でデータベースが検索される場合が多いが、デー
タベースが昇順または降順のごとく、ある決められた順
にソートされていないと検索に時間がかかる。このた
め、データの追加などによってソートされていないデー
タが一定量に達すると、通常自動的にソート処理が実施
されるようになっており、その間オペレータは待たされ
る。The database is often searched for in business processing in the terminal device, but if the database is not sorted in a predetermined order such as ascending order or descending order, it takes time to search. Therefore, when the amount of unsorted data reaches a certain amount due to the addition of data or the like, the sorting process is normally performed automatically, and the operator is kept waiting during that time.
【0010】このソート処理には前述したマージソート
法等が採用されているが、近年ではハードディスクの容
量の増大によってデータ量が多くなっており、益々ソー
ト処理に時間を要している。The above-described merge sort method or the like is adopted for this sort processing, but in recent years the amount of data has increased due to the increase in the capacity of the hard disk, and the sort processing requires more and more time.
【0011】本発明は、上記課題に鑑み、ソート時間を
短縮するマージソート方法を提供することを目的とす
る。In view of the above problems, it is an object of the present invention to provide a merge sort method that shortens the sort time.
【0012】[0012]
【課題を解決するための手段】上記課題を解決するた
め、本発明のマージソート方法は、図1本発明の原理図
に示すように、
(1) ソート対象のデータ列を検索してソート処理不要な
部分集合を抽出し、この部分集合をソート済み並びとし
て併合する所定のマージ処理を行って、該データ列をソ
ートする。
(2) 上記(1) を実現するマージソート処理装置として、
ソート処理対象のデータ列を検索してソート不要な部分
集合を抽出するソート不要部抽出処理部と、前記部分集
合を基準として所定のマージ処理を行うマージ処理部と
を備えるように構成する。In order to solve the above-mentioned problems, the merge sort method of the present invention, as shown in the principle diagram of FIG. 1 of the present invention, is as follows: (1) A data string to be sorted is searched and a sorting process is performed. Unnecessary subsets are extracted, and a predetermined merge process is performed to merge the subsets as a sorted list to sort the data strings. (2) As a merge sort processing device that realizes (1) above,
It is configured to include a sort unnecessary portion extraction processing unit that searches a data string to be sorted and extracts a subset that does not require sorting, and a merge processing unit that performs a predetermined merge process based on the subset.
【0013】[0013]
(1) 先ず、ソート対象のデータ列からソート処理不要な
一連のデータ列を部分集合(ソート不要部)として抽出
する。この部分集合を最初の整列済み並びとして、振り
分け、且つ併合する所定のマージ処理を遂行していく。(1) First, a series of data strings that do not require a sorting process are extracted as a subset (sort unnecessary part) from the data string to be sorted. A predetermined merge process for sorting and merging the subsets as the first sorted list is performed.
【0014】一般にソートする場合には、整列済みのデ
ータ列の部分が多いから、この集合をスタートとしてマ
ージソートを遂行すると、大幅にソート時間が短縮され
る。なお、この際、各部分集合の大きさは一定である必
要はない。
(2) 上記(1) を実現する装置において、ソート不要部抽
出処理部はソート対象のデータ列からソート処理不要な
一連のデータを部分集合として抽出し、マージ処理部
は、この部分集合を基準として所定のマージ処理を行
う。In general, when sorting is performed, there are many sorted data strings. Therefore, when the merge sort is performed starting from this set, the sort time is significantly shortened. At this time, the size of each subset does not have to be constant. (2) In the device that realizes (1) above, the sort unnecessary part extraction processing unit extracts a series of data that does not require sort processing from the data string to be sorted as a subset, and the merge processing unit uses this subset as a reference. As a predetermined merge process is performed.
【0015】以上のごとく、ソート不要な部分集合が大
きければ、従来例と比較して、最初の数段階のマージ処
理を省くことができ、ソート処理速度を大幅に短縮する
ことができる。As described above, if the sort-unnecessary subset is large, the first few steps of merge processing can be omitted and the sort processing speed can be greatly reduced, as compared with the conventional example.
【0016】[0016]
【実施例】図2は一実施例の構成図、図3は基本動作フ
ローチャート図、図4はソート不要部分抽出処理フロー
チャート図、図5はソート不要部分抽出処理例を表す
図、図6はマージソート処理フローチャート図、図7は
マージソート処理例を表す図である。FIG. 2 is a block diagram of one embodiment, FIG. 3 is a flowchart of basic operation, FIG. 4 is a flowchart of sort unnecessary portion extraction processing, FIG. 5 is a diagram showing sort unnecessary portion extraction processing example, and FIG. FIG. 7 is a flowchart of sort processing, and FIG. 7 is a diagram illustrating an example of merge sort processing.
【0017】本実施例では、具体的説明として、図8に
示す8レコード(レコードはデータの単位)のデータ列
に適用したものを示す。このレコード数はソート処理を
行うバッファ容量に制限されるもので、この部分の処理
はいわゆる内部ソートと称される。ソート対象のデータ
列がこのバッファ容量(ここでは8レコード)より大き
い場合、この8レコードをブロックとして、いわゆる外
部ソートを行う。In the present embodiment, as a concrete explanation, what is applied to a data string of 8 records (a record is a unit of data) shown in FIG. 8 is shown. This number of records is limited by the buffer capacity for performing the sorting process, and the process of this part is called so-called internal sorting. If the data string to be sorted is larger than this buffer capacity (8 records in this case), so-called external sorting is performed using these 8 records as a block.
【0018】図2は、データ処理装置(端末装置)のう
ちのマージソート部分を示したものである。図2におい
て、1は中央処理ユニットCPUで、プログラムで構成
される下記各部を走行させ、本実施例のマージソート処
理の制御を行う。FIG. 2 shows the merge sort part of the data processing device (terminal device). In FIG. 2, reference numeral 1 denotes a central processing unit CPU, which runs the following respective parts constituted by programs to control the merge sort processing of the present embodiment.
【0019】2はマージソート制御部で、データ読込処
理部3,ソート不要部抽出処理部4,ソート不要部マー
ジ処理部5,データ書込処理部6より構成される。ここ
で、データ読込処理部3は、ファイル装置7よりソート
対象のデータ列のうちからバッファ容量に応じた数のデ
ータを順に読み出してバッファ9に格納するもの、ソー
ト不要部抽出処理部4は、バッファ9に格納されたデー
タをサーチし、ソート処理不要(ここでは昇順とする)
な連続したデータ列(ソート不要部)を抽出し、そのデ
ータ列の先頭レコードNOをソートインデックス10に保
存するもの、ソート不要部マージ処理部5は、ソートイ
ンデックス10を参照し、ソート不要部間のマージソート
処理を行うもの、データ書込処理部6は、ソート完了し
たレコードNOにデータを置換してファイル装置7に格
納するものである。Reference numeral 2 denotes a merge sort control unit, which comprises a data read processing unit 3, a sort unnecessary portion extraction processing unit 4, a sort unnecessary portion merge processing unit 5, and a data writing processing unit 6. Here, the data read processing unit 3 sequentially reads from the file device 7 a number of data corresponding to the buffer capacity from the data string to be sorted and stores the data in the buffer 9, and the sort unnecessary part extraction processing unit 4 The data stored in the buffer 9 is searched, and the sorting process is unnecessary (here, the ascending order is used).
A continuous data sequence (sort unnecessary part) is extracted, and the first record NO of the data sequence is stored in the sort index 10. The sort unnecessary part merge processing unit 5 refers to the sort index 10 The data writing processing unit 6 replaces the data with the sorted record No. and stores it in the file device 7.
【0020】7はファイル装置で、ソート対象データが
格納されている。8はメモリで、マージソート処理を行
うためのバッファ9と、マージ処理を行うための後述す
るソートインデックス10などが含まれる。A file device 7 stores data to be sorted. A memory 8 includes a buffer 9 for performing merge sort processing, a sort index 10 described below for performing merge processing, and the like.
【0021】ここで、ソートインデックス10はソート不
要部の先頭レコードNOがレコードNO順に格納された
もので、後述するが、図5にその生成過程を示してい
る。以下、次のようにしてマージソート処理が行われ
る。Here, the sort index 10 is a record in which the first record NO of the unsorted portion is stored in the order of the record NO. As will be described later, FIG. 5 shows its generation process. Hereinafter, the merge sort process is performed as follows.
【0022】〔基本動作〕図3参照
(1) ファイル装置7より読込まれたデータ列はソート不
要部抽出処理部4によってサーチされ、ソート不要部抽
出処理が行われる。この結果、ソート不要部の先頭レコ
ードNOのみを格納したソートインデックス10と、各ソ
ート不要部のレコードNO数が得られる。
(2) ソート不要部マージ処理部5によって各ソート不要
部間のマージ処理が行われる。この際レコードNOのみ
がソートされる。
(3) マージ処理が完了すると、ソートされたレコードN
Oが実データに置き換えられ、ファイル装置7に格納さ
れる。[Basic Operation] See FIG. 3 (1) The data string read from the file device 7 is searched by the sort unnecessary portion extraction processing unit 4, and sort unnecessary portion extraction processing is performed. As a result, the sort index 10 that stores only the first record No of the sort unnecessary section and the number of record Nos of each sort unnecessary section are obtained. (2) The sort unnecessary section merge processing unit 5 performs the merge processing between the respective sort unnecessary sections. At this time, only the record number is sorted. (3) When the merge process is completed, the sorted records N
O is replaced with actual data and stored in the file device 7.
【0023】以下、詳細な動作は以下の通りである。
〔ソート不要部抽出処理〕図4参照
前述した基本動作(1) に相当し、マージ処理の前処理と
して行われる。
(1) データ読込処理部3は、読み込み可能なレコード数
分(n) のデータをバッファ9に読み込む。
(2) ソートインデックス10の初期化を行う。ここで、バ
ッファ9に格納されたデータに対し、レコードNOとし
て0から7までを付与する。
(3) 先頭から順に隣り合うレコードを比較する。先ず、
m=0として(m)と(m+1)を比較する。ここで
(m)はレコードNO=mの内容を表す。
(4) (m)>(m+1)ならば、(m+1)のレコード
NOをソートインデックス10に保存する。この保存され
たレコードNOがソート不要部の先頭レコードとなる。
(m)≦(m+1)ならば、下記(6) に進む。
(5) ソートインデックス10に格納したレコードNO数を
計数する。
(6) m=m+1として、(3) から繰り返す。The detailed operation is as follows. [Sort Unnecessary Part Extraction Process] See FIG. 4, which corresponds to the basic operation (1) described above, and is performed as a preprocess of the merge process. (1) The data read processing unit 3 reads into the buffer 9 the data corresponding to the number of readable records (n). (2) Initialize the sort index 10. Here, 0 to 7 are added as the record number to the data stored in the buffer 9. (3) Compare adjacent records in order from the beginning. First,
With (m = 0), (m) and (m + 1) are compared. Here, (m) represents the content of the record NO = m. (4) If (m)> (m + 1), the record number of (m + 1) is stored in the sort index 10. This stored record number becomes the first record of the sort unnecessary part.
If (m) ≤ (m + 1), proceed to (6) below. (5) Count the number of record NOs stored in the sort index 10. (6) Repeat from (3) with m = m + 1.
【0024】以上により、図5に示すようなソートイン
デックス10が得られる。即ち、初期値としてm1=0
が保存され、次にレコードNO=2のデータとレコード
NO=3のデータとの比較でレコードNO=2までが
ソート不要部と判明するので、m1+1=m2=3が保
存され、レコードNO=5のところで同様にソート要
となるのでm3=5が保存される。そして、それぞれレ
コードNO数として、3(A群),2(B群),3(C
群)が計数される。From the above, the sort index 10 as shown in FIG. 5 is obtained. That is, m1 = 0 as an initial value
Is stored. Next, by comparing the data of record NO = 2 and the data of record NO = 3, it is found that the records up to record NO = 2 are sort unnecessary parts. Therefore, m1 + 1 = m2 = 3 is stored and record NO = 5. At this point, similarly, since sorting is required, m3 = 5 is stored. The number of record NOs is 3 (group A), 2 (group B), 3 (C).
Groups) are counted.
【0025】〔マージソート処理〕ソート不要部マージ
処理部5の処理で、前述した基本動作(1) のソート不要
部間のマージである。この際、ソートインデックス10と
前述したレコードNO数が使用される。ソートインデッ
クス10はマージ処理されるごとに併合され、最後はソー
トインデックス数は1 となる。[Merge Sorting Process] Sort-necessary part In the process of the merge processor 5, the above-mentioned basic operation (1) is a merge between sort-unnecessary parts. At this time, the sort index 10 and the number of record NOs described above are used. The sort indexes 10 are merged every time merge processing is performed, and the number of sort indexes becomes 1 at the end.
【0026】図3に示すように、先ず、ソートインデッ
クス数を検索する。本例では、図5に示すように、最初
はm1,m2,m3まであるからソートインデックス数
は3であるからマージ処理を行う。1ならばすべて整列
したことを表すからマージ処理を終了する。As shown in FIG. 3, first, the number of sort indexes is searched. In this example, as shown in FIG. 5, since there are m1, m2, and m3 at the beginning, the number of sort indexes is 3, so the merge process is performed. If the value is 1, it means that all are aligned, and the merge process is terminated.
【0027】ソートインデックス数>1ならば、ソート
インデックス10の先頭から2組づつデータ群を取り出し
て(図1ではAとB,CとD、図5ではAとB,C)、
それぞれマージ処理を行う。If the number of sort indexes> 1, two data groups are taken out from the beginning of the sort index 10 (A and B, C and D in FIG. 1, A and B and C in FIG. 5),
Each merge process is performed.
【0028】以下1組(A群,B群)についてマージ処
理例を説明する。図6,図7参照
(1) ソートインデックス10を参照して、2つのデータ群
A,Bの先頭からレコードNOを1つづつ取り出す。
(2) そのレコードNOに対応する実データ(A),
(B)をバッファ9より抽出する。
(3) 抽出した実データを比較し、(A)≧(B)なら
ば、(B)をバッファ9に設けた出力バッファに格納す
る。
(4) 一方、(A)<(B)ならば、(A)を出力バッフ
ァに格納し、次にその(B)と次の(A)とを比較す
る。A merge process example will be described below for one set (group A, group B). See FIG. 6 and FIG. 7 (1) With reference to the sort index 10, record NOs are taken out one by one from the heads of the two data groups A and B. (2) Actual data (A) corresponding to the record No.,
(B) is extracted from the buffer 9. (3) The extracted actual data are compared, and if (A) ≧ (B), (B) is stored in the output buffer provided in the buffer 9. (4) On the other hand, if (A) <(B), (A) is stored in the output buffer, and then (B) is compared with the next (A).
【0029】上記(3) と(4) とが繰り返され、比較する
データが無くなると、残った側のデータを出力バッファ
に順に格納して終了する。この結果、A群とB群のレコ
ードNOが併合され、ソートインデックス10が更新され
る。この更新により、A,Bが併合されたソートインデ
ックス10が生成される。同時に対応するレコードNO数
も更新される。When the above (3) and (4) are repeated and there is no more data to be compared, the data on the remaining side are sequentially stored in the output buffer, and the process ends. As a result, the record numbers of the A group and the B group are merged, and the sort index 10 is updated. By this update, the sort index 10 in which A and B are merged is generated. At the same time, the corresponding record number is updated.
【0030】以上により、先頭2組づつマージ処理を行
い、次にマージされたデータ2組づつのマージ処理を行
う。この結果、出力バッファには、最終的にソートされ
たレコードNOが得られるので、実データに置き換えら
れて、ファイル装置7に格納される。As described above, the merging process is performed for each of the first two sets, and then the merging process is performed for each of the two sets of merged data. As a result, finally sorted record numbers are obtained in the output buffer, so that the record numbers are replaced with actual data and stored in the file device 7.
【0031】図7で以上のことを説明すると次のように
なる。最初はA群とB群の比較であり、ステップ1の
の比較が行われる。このため、先ず、ソートインデック
ス10を参照して、A群,B群の先頭レコードNOとし
て、レコードNO=0,レコードNO=3を取り出す。
(A)=0002,(B)=0001であるから、
(A)≧(B)となって、(B)のレコードNO=3を
出力バッファに格納する。The above will be described with reference to FIG. 7 as follows. The first is the comparison between the A group and the B group, and the comparison in step 1 is performed. Therefore, first, with reference to the sort index 10, the record NO = 0 and the record NO = 3 are taken out as the first record NO of the A group and the B group.
Since (A) = 0002 and (B) = 0001,
(A) ≧ (B), and the record No. = 3 in (B) is stored in the output buffer.
【0032】続いてステップ1のの比較を行う。
(B)としてB群のうちから次のレコードNOのデータ
(0007)を抽出し、(A)=(0002)と比較す
る。この結果(A)のレコードNO=0が出力バッファ
に格納される。Subsequently, the comparison in step 1 is performed.
As (B), the data (0007) of the next record NO is extracted from the B group and compared with (A) = (0002). The record NO = 0 of the result (A) is stored in the output buffer.
【0033】このようにして、比較,が行われ、最
後に(0007)が残るから、このレコードNOを出力
バッファに格納する。そしてソートインデックス10の数
は2となり、図7に示した構成となる。In this way, the comparison is performed, and (0007) remains at the end, so this record number is stored in the output buffer. Then, the number of sort indexes 10 becomes 2, and the configuration shown in FIG. 7 is obtained.
【0034】このA群とB群のマージが終了すると、ス
テップ2として、(A+B)とCとのマージ処理が前述
と同様に行われる。そしてソートインデックス10の数は
1となるからマージが終了する。When the merging of the groups A and B is completed, the merging process of (A + B) and C is performed as step 2 in the same manner as described above. Then, since the number of sort indexes 10 becomes 1, the merge ends.
【0035】以上のごとく、ソート対象のデータ列をサ
ーチして、ソート不要部分を抽出し、この不要部分から
マージを開始することにより、データ単位からのマージ
処理を省くことができる。この結果、通常はソート不要
部分が大きいから、マージソート処理が大幅に高速化さ
れる。As described above, the data string to be sorted is searched, the unnecessary sorting portion is extracted, and the merging is started from this unnecessary portion, whereby the merging process from the data unit can be omitted. As a result, the sort-unnecessary portion is usually large, so that the merge sort process is significantly speeded up.
【0036】なお、上記マージ処理の方法は1例であ
り、他のマージ処理方式に適用できることは勿論であ
る。It should be noted that the above merge processing method is only an example and can be applied to other merge processing methods.
【0037】[0037]
【発明の効果】以上説明したように、本発明は、先ず、
ソート対象のデータ列をサーチして整列処理不要の一連
のデータ列を抽出し、このデータ列を部分集合としてマ
ージ処理を開始するようにしたので、最小データ単位か
らマージ処理を行う従来の方法と比較してマージ処理数
を大幅に省略することができ、処理速度が改善される効
果は極めて大きい。As described above, according to the present invention, first,
Since a series of data strings that do not require sorting processing are extracted by searching the data strings to be sorted and the merge process is started with this data string as a subset, the conventional method of performing the merge process from the smallest data unit Compared with this, the number of merge processes can be greatly omitted, and the effect of improving the processing speed is extremely large.
【図1】 本発明の原理図FIG. 1 is a principle diagram of the present invention.
【図2】 一実施例の構成図FIG. 2 is a configuration diagram of an embodiment.
【図3】 基本動作フローチャート図[Figure 3] Basic operation flowchart
【図4】 ソート不要部分抽出処理フローチャート図FIG. 4 is a flowchart of sort unnecessary portion extraction processing.
【図5】 ソート不要部分抽出処理例を表す図FIG. 5 is a diagram showing an example of sort unnecessary portion extraction processing.
【図6】 マージソート処理フローチャート図FIG. 6 is a flowchart of merge sort processing.
【図7】 マージソート処理例を表す図FIG. 7 is a diagram showing an example of merge sort processing.
【図8】 従来例のマージソート方法説明図FIG. 8 is an explanatory diagram of a conventional merge sort method.
1 中央処理ユニットCPU 2 マージソー
ト制御部
3 データ読込処理部 4 ソート不要
部抽出処理部
5 ソート不要部マージ処理部 6 データ書込
処理部
7 ファイル装置 8 メモリ
9 バッファ 10 ソートイン
デックス1 central processing unit CPU 2 merge sort control unit 3 data read processing unit 4 sort unnecessary section extraction processing unit 5 sort unnecessary section merge processing unit 6 data writing processing unit 7 file device 8 memory 9 buffer 10 sort index
───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平2−206830(JP,A) 特開 平4−354019(JP,A) 特開 平5−165604(JP,A) 特開 平6−103028(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 7/24 G06F 7/32 G06F 17/30 ─────────────────────────────────────────────────── --- Continuation of the front page (56) References JP-A-2-206830 (JP, A) JP-A-4-354019 (JP, A) JP-A-5-165604 (JP, A) JP-A-6- 103028 (JP, A) (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 7/24 G06F 7/32 G06F 17/30
Claims (2)
ト処理不要な部分集合を抽出し、この部分集合をソート
済み並びとして併合する所定のマージ処理を行って、該
データ列をソートすることを特徴とするマージソート方
法。1. Sorting a data string to be sorted by extracting a subset that does not require sorting processing and performing a predetermined merge process that merges this subset as a sorted list to sort the data string. Characteristic merge sort method.
ト処理不要な部分集合を抽出するソート不要部抽出処理
部と、 前記部分集合を基準として所定のマージ処理を行うマー
ジ処理部とを備えることを特徴とするマージソート処理
装置。2. An unneeded portion extraction processing unit that retrieves a data string to be sorted and extracts a subset that does not require sorting processing; and a merge processing unit that performs a predetermined merging process based on the subset. A merge sort processing device characterized by:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2801395A JP3534471B2 (en) | 1995-02-16 | 1995-02-16 | Merge sort method and merge sort device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2801395A JP3534471B2 (en) | 1995-02-16 | 1995-02-16 | Merge sort method and merge sort device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH08221254A JPH08221254A (en) | 1996-08-30 |
| JP3534471B2 true JP3534471B2 (en) | 2004-06-07 |
Family
ID=12236898
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2801395A Expired - Lifetime JP3534471B2 (en) | 1995-02-16 | 1995-02-16 | Merge sort method and merge sort device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP3534471B2 (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005190248A (en) * | 2003-12-26 | 2005-07-14 | Toudai Tlo Ltd | Sequence search system and search program |
| JP2009199439A (en) * | 2008-02-22 | 2009-09-03 | Nec Corp | Merge sort processing method, merge sort processing device, and merge sort processing program |
| JP5099525B2 (en) * | 2009-03-27 | 2012-12-19 | アイシン・エィ・ダブリュ株式会社 | Navigation device and program |
| KR101482229B1 (en) * | 2013-04-29 | 2015-01-14 | 주식회사 실리콘아츠 | Computer enabled method of data sort, system performing the same and storage media storing the same |
| KR101465447B1 (en) * | 2014-03-31 | 2014-12-10 | 성균관대학교산학협력단 | Method for external merge sort, system for external merge sort and distributed processing system for external merge sort |
-
1995
- 1995-02-16 JP JP2801395A patent/JP3534471B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH08221254A (en) | 1996-08-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0510634B1 (en) | Data base retrieval system | |
| JP2607818B2 (en) | Method and apparatus for determining whether a record is stored in a computer system | |
| JP4261779B2 (en) | Data compression apparatus and method | |
| US7103536B1 (en) | Symbol dictionary compiling method and symbol dictionary retrieving method | |
| CN1531692A (en) | Efficient ordering element structure for processing large numbers of characters | |
| JP2003044267A (en) | Data sort method, data sort device, and data sort program | |
| US5842208A (en) | High performance recover/build index system by unloading database files in parallel | |
| CN108804204A (en) | Multi-threaded parallel constructs the method and system of Suffix array clustering | |
| JP3534471B2 (en) | Merge sort method and merge sort device | |
| US20040044683A1 (en) | Data compiling method | |
| US6226411B1 (en) | Method for data compression and restoration | |
| JP3370787B2 (en) | Character array search method | |
| JP3131142B2 (en) | Map data linkage system | |
| JP4208326B2 (en) | Information indexing device | |
| JP3081093B2 (en) | Index creation method and apparatus and document search apparatus | |
| JP2993540B2 (en) | Ascending integer sequence data compression and decoding system | |
| JP2786380B2 (en) | Keyword matching search processing method | |
| CN109299260B (en) | Data classification method, device and computer readable storage medium | |
| JP4181723B2 (en) | Index creating apparatus, index creating method, and recording medium | |
| CN107451125B (en) | Method for performing rapid close semantic matching aiming at sequence-independent item groups | |
| JPH10134084A (en) | Data processing device | |
| JP3115459B2 (en) | Method of constructing and retrieving character recognition dictionary | |
| JPH07319888A (en) | Index retrieval system | |
| JPH06149635A (en) | Method for additional processing of record | |
| US9350383B2 (en) | Run total encoded data processing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20040217 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20040309 |
|
| R150 | Certificate of patent (=grant) or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080319 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090319 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100319 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100319 Year of fee payment: 6 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110319 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110319 Year of fee payment: 7 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120319 Year of fee payment: 8 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130319 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130319 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140319 Year of fee payment: 10 |
|
| EXPY | Cancellation because of completion of term |