JPH0793129A - Sort system - Google Patents

Sort system

Info

Publication number
JPH0793129A
JPH0793129A JP4116591A JP11659192A JPH0793129A JP H0793129 A JPH0793129 A JP H0793129A JP 4116591 A JP4116591 A JP 4116591A JP 11659192 A JP11659192 A JP 11659192A JP H0793129 A JPH0793129 A JP H0793129A
Authority
JP
Japan
Prior art keywords
data
storage unit
address
additional data
additional
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.)
Withdrawn
Application number
JP4116591A
Other languages
Japanese (ja)
Inventor
Yoshiyuki Koganeya
嘉行 古金谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP4116591A priority Critical patent/JPH0793129A/en
Publication of JPH0793129A publication Critical patent/JPH0793129A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To improve the sort efficiency. CONSTITUTION:A retrieval inserting means successively searches a data address part 201 and retrieves a rough position to insert additional data by referring to a data storage part 101 instructed by an address stored in the data address storage part 201. Next, the data inserting position is decided by referring to the data storage part 101 instructed by an address stored in a next data address storage part 102 successively from this rough position, the additional data are inserted, and the value of an additional data counter 202 corresponding to the rough position is counted up. When the value of this additional data counter 202 reaches a previously decided value, a second storage part generating means successively draws in the addresses stored in the next data address storage part 102 at the rough position, this drawn-in address is stored in the data address storage part 201 for every previously decided number, and the additional data counter 202 is initialized.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はデータのソート方式に関
し、特に挿入法によるソート方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data sorting system, and more particularly to a sorting system using an insertion method.

【0002】[0002]

【従来の技術】従来の方法では、データと、そのデータ
よりも小さいデータを指すポインタと、大きいデータを
指すポインタとをバイナリーツリー(2分木)状に構成
することでソートを実現している。(尚、バイナリーツ
リーに関しては情報処理ハンドブックなどを参照のこ
と)
2. Description of the Related Art In a conventional method, sorting is realized by configuring data, a pointer pointing to data smaller than the data, and a pointer pointing to large data in a binary tree (binary tree) form. . (Please refer to the information processing handbook etc. for the binary tree.)

【発明が解決しようとする課題】上述した従来のソート
方式は、ツリーが対称形でない場合はソート効率が悪く
なるという欠点があった。
The above-mentioned conventional sorting method has a drawback that the sorting efficiency becomes poor if the tree is not symmetrical.

【0003】[0003]

【課題を解決するための手段】第1の発明は、データの
ソート方式において、データを格納するデータ格納部と
予め決められた順序に配列された前記データの次のデー
タのアドレスを格納する次データアドレス格納部から成
る第一の組を複数組備えた第一の記憶部と前記第一の組
を予め決められた数毎に選択し選択された前記第一の組
のアドレスを格納するデータアドレス格納部と追加デー
タの数を格納する追加データカウンターから成る第二の
組を複数組備えた第二の記憶部とを備え、前記データア
ドレス格納部を順番にサーチし前記データアドレス格納
部に格納されたアドレスが指している前記第一の組にお
ける前記データ格納部を参照して予め決められた第一の
アルゴリズムにより前記追加データを挿入する概略位置
としての前記第一の組を検索し次に前記概略位置として
の第一の組から順番に前記次データアドレス格納部に格
納されたアドレスが指している前記データ格納部を参照
して予め決められた第二のアルゴリズムによりデータ挿
入位置を決定し前記追加データを挿入するとともに前記
概略位置としての第一の組に対応する前記第二の組にお
ける前記追加データカウンターの値をカウントアップす
る検索挿入手段を備えたことを特徴とする。
According to a first aspect of the present invention, in a data sorting system, a data storage unit for storing data and an address for the next data of the data arranged in a predetermined order are stored. Data for storing a first storage unit having a plurality of first sets each comprising a data address storage unit and the first sets selected for each predetermined number and storing the addresses of the selected first sets An address storage unit and a second storage unit having a plurality of second sets of additional data counters for storing the number of additional data, and the data address storage unit is searched in order and stored in the data address storage unit. The first as a general position for inserting the additional data by the first algorithm determined in advance by referring to the data storage unit in the first set pointed to by the stored address A set is searched, and then a second algorithm predetermined with reference to the data storage unit pointed to by the address stored in the next data address storage unit in order from the first set as the rough position A search insertion means for determining a data insertion position, inserting the additional data, and counting up the value of the additional data counter in the second set corresponding to the first set as the general position. And

【0004】また、第2の発明は、前記追加データカウ
ンターの値が予め決められた値になると前記概略位置と
しての第一の組から前記次データアドレス格納部に格納
されたアドレスを順次たどり予め決められた数毎に前記
第一の組のアドレスを前記データアドレス格納部に格納
するとともに前記追加データカウンターを初期化する第
2記憶部生成手段を備えたことを特徴とする。
According to a second aspect of the present invention, when the value of the additional data counter reaches a predetermined value, the addresses stored in the next data address storage unit are sequentially traced from the first set as the rough position in advance. It is characterized by further comprising a second storage unit generating means for storing the first set of addresses in the data address storage unit for each predetermined number and initializing the additional data counter.

【0005】[0005]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will now be described with reference to the drawings.

【0006】図1は本発明の一実施例を示すブロック図
である。
FIG. 1 is a block diagram showing an embodiment of the present invention.

【0007】第1記憶部100は、データを格納するた
めのデータ格納部101と、次のデータへのアドレスを
格納するための次データアドレス格納部102から成る
組を複数組備えている。
The first storage unit 100 is provided with a plurality of sets of a data storage unit 101 for storing data and a next data address storage unit 102 for storing an address to the next data.

【0008】第2記憶部200は、データへのアドレス
を格納するためのデータアドレス格納部201と、追加
データの数を格納するための追加データカウンター20
2から成る組を複数組備えている。
The second storage unit 200 includes a data address storage unit 201 for storing an address to data and an additional data counter 20 for storing the number of additional data.
A plurality of groups of 2 are provided.

【0009】検索挿入手段300は、まず、データアド
レス格納部201に格納されたアドレスが指しているデ
ータ格納部101を参照して、追加データを挿入する概
略の位置を検索する。次に、次データアドレス格納部1
02に格納されたアドレスが指しているデータ格納部1
01を参照して挿入位置を詳細に検索する。挿入位置が
決まったら、次データアドレス格納部102のアドレス
を変更して、追加データを挿入する。このとき、追加デ
ータカウンター202もカウントアップする。
First, the search / insertion means 300 refers to the data storage unit 101 pointed to by the address stored in the data address storage unit 201 to search for a rough position for inserting additional data. Next, next data address storage unit 1
Data storage unit 1 pointed to by the address stored in 02
With reference to 01, the insertion position is searched in detail. When the insertion position is determined, the address of the next data address storage unit 102 is changed and the additional data is inserted. At this time, the additional data counter 202 also counts up.

【0010】第2記憶部生成手段400は、追加データ
カウンター202の値が予め決められた値になると、次
データアドレス格納部102を順次たどりながら、予め
決められた間隔でデータアドレス格納部201にデータ
アドレスを格納し、追加データカウンター202を初期
化する。
When the value of the additional data counter 202 reaches a predetermined value, the second storage section generating means 400 sequentially traces the next data address storage section 102 and stores the data in the data address storage section 201 at predetermined intervals. The data address is stored and the additional data counter 202 is initialized.

【0011】図2および図3は、図1の第1記憶部10
0と第2記憶部200の関係の詳細を具体的に示す図で
ある。図2は、データ10,20,…,70および80
を昇順に格納した状態を示す。図3は、図2に追加デー
タ51を挿入した状態を示す。図4は、図1のソート方
式の手順を示す流れ図である。
2 and 3 show the first storage section 10 of FIG.
3 is a diagram specifically showing details of the relationship between 0 and the second storage unit 200. FIG. FIG. 2 shows data 10, 20, ..., 70 and 80.
Is stored in ascending order. FIG. 3 shows a state in which the additional data 51 is inserted in FIG. FIG. 4 is a flow chart showing the procedure of the sorting method of FIG.

【0012】図2の状態に51のデータを追加して図3
の状態にする場合について、図4を参照しながら具体的
に説明する。
FIG. 3 is obtained by adding 51 data to the state of FIG.
The case of setting the state will be specifically described with reference to FIG.

【0013】検索挿入手段300は、1つめのデータア
ドレス格納部201に格納されたアドレスが指している
データ格納部101のデータ10を比較データとする
(ステップ1)。比較データが追加データ51より大き
いか否かを調べる(ステップ2)。比較データ10は追
加データより小さいので、比較データ10を前比較デー
タとし、2つめのデータアドレス格納部201に移る
(ステップ3)。データ40についても同様に繰り返
し、比較データ40についても前比較データとする(ス
テップ1〜ステップ3)。3つめのデータ70を比較デ
ータする(ステップ1)。比較データ70が追加データ
51より大きいか否かを調べる(ステップ2)。比較デ
ータ70は追加データ51より大きいので、前比較デー
タ40を指している追加データカウンター202を1増
加する(ステップ4)。前比較データ40の次データア
ドレス格納部102に格納されたアドレスが指している
データ格納部101のデータ50を比較データとする
(ステップ5)。比較データ50が追加データ51より
大きくはないので、比較データ50を前比較データとす
る(ステップ7)。前比較データ50の次データアドレ
ス格納部102に格納されたアドレスが指しているデー
タ格納部101のデータ60を比較データとする(ステ
ップ5)。比較データ60が追加データ51より大きい
ので、前比較データ50の次に追加データ51を挿入す
る(ステップ8)。
The search insertion means 300 uses the data 10 in the data storage unit 101 pointed to by the address stored in the first data address storage unit 201 as comparison data (step 1). It is checked whether the comparison data is larger than the additional data 51 (step 2). Since the comparison data 10 is smaller than the additional data, the comparison data 10 is used as the pre-comparison data, and the data is moved to the second data address storage unit 201 (step 3). The data 40 is similarly repeated, and the comparison data 40 is also set as the pre-comparison data (steps 1 to 3). The third data 70 is compared (step 1). It is checked whether the comparison data 70 is larger than the additional data 51 (step 2). Since the comparison data 70 is larger than the additional data 51, the additional data counter 202 pointing to the previous comparison data 40 is incremented by 1 (step 4). The data 50 in the data storage unit 101 pointed to by the address stored in the next data address storage unit 102 of the previous comparison data 40 is used as comparison data (step 5). Since the comparison data 50 is not larger than the additional data 51, the comparison data 50 is used as the pre-comparison data (step 7). The data 60 in the data storage unit 101 pointed to by the address stored in the next data address storage unit 102 of the previous comparison data 50 is used as comparison data (step 5). Since the comparison data 60 is larger than the additional data 51, the additional data 51 is inserted after the previous comparison data 50 (step 8).

【0014】以上の手順のうち、ステップ1〜ステップ
3の操作については、バイナリーサーチにより高速化を
はかることも可能である。
Of the above procedures, the operations of steps 1 to 3 can be speeded up by a binary search.

【0015】以上のように、追加データの挿入を繰り返
すとステップ5〜ステップ7の操作が増加し、検索時間
が増大する。この増加は、追加データカウンター202
の数を増加することによって対処する。即ち、追加デー
タカウンター202の値が予め決められた値になると、
第2記憶部生成手段400は、次データアドレス格納部
102を順次たどりながら、予め決められた間隔でデー
タアドレス格納部201にデータアドレスを格納し、追
加データカウンター202を初期化する。
As described above, when the insertion of additional data is repeated, the operations of steps 5 to 7 increase, and the search time increases. This increase is due to the additional data counter 202
To deal with by increasing the number of. That is, when the value of the additional data counter 202 reaches a predetermined value,
The second storage unit generating means 400 stores data addresses in the data address storage unit 201 at predetermined intervals while sequentially tracing the next data address storage unit 102, and initializes the additional data counter 202.

【0016】[0016]

【発明の効果】以上説明したように、本発明は、ソート
用のデータを特定の間隔で検索して概略のソーティング
位置を定め、その範囲内でソーティングするようにした
ことにより、ツリー形でないデータ値の大きさ順にシー
ケンシャルに配列されたデータ構造に対してもソート効
率が良くなるという効果がある。特に、データ構造に応
じて検索間隔を最適に選択できるという効果がある。
As described above, according to the present invention, the sorting data is searched at a specific interval to determine a rough sorting position, and sorting is performed within the range, so that the non-tree type data is sorted. This has the effect of improving the sorting efficiency even for a data structure that is sequentially arranged in the order of the size of the value. In particular, there is an effect that the search interval can be optimally selected according to the data structure.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】本実施例の動作の一例を示す説明図である。FIG. 2 is an explanatory diagram showing an example of the operation of the present embodiment.

【図3】本実施例の動作の一例を示す説明図である。FIG. 3 is an explanatory diagram showing an example of the operation of the present embodiment.

【図4】本実施例のソート方式の手順を示す流れ図であ
る。
FIG. 4 is a flowchart showing a procedure of a sorting method of this embodiment.

【符号の説明】[Explanation of symbols]

100 第1記憶部 101 データ格納部 102 次データアドレス格納部 200 第2記憶部 201 データアドレス格納部 202 追加データカウンター 300 検索挿入手段 400 第2記憶部生成手段 100 first storage unit 101 data storage unit 102 next data address storage unit 200 second storage unit 201 data address storage unit 202 additional data counter 300 search insertion unit 400 second storage unit generation unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】データのソート方式において、データを格
納するデータ格納部と予め決められた順序に配列された
前記データの次のデータのアドレスを格納する次データ
アドレス格納部から成る第一の組を複数組備えた第一の
記憶部と前記第一の組を予め決められた数毎に選択し選
択された前記第一の組のアドレスを格納するデータアド
レス格納部と追加データの数を格納する追加データカウ
ンターから成る第二の組を複数組備えた第二の記憶部と
を備え、前記データアドレス格納部を順番にサーチし前
記データアドレス格納部に格納されたアドレスが指して
いる前記第一の組における前記データ格納部を参照して
予め決められた第一のアルゴリズムにより前記追加デー
タを挿入する概略位置としての前記第一の組を検索し次
に前記概略位置としての第一の組から順番に前記次デー
タアドレス格納部に格納されたアドレスが指している前
記データ格納部を参照して予め決められた第二のアルゴ
リズムによりデータ挿入位置を決定し前記追加データを
挿入するとともに前記概略位置としての第一の組に対応
する前記第二の組における前記追加データカウンターの
値をカウントアップする検索挿入手段を備えたことを特
徴とするソート方式。
1. A first set of data sorting methods, comprising a data storage unit for storing data and a next data address storage unit for storing the address of the next data of the data arranged in a predetermined order. A first storage unit including a plurality of sets, a data address storage unit that stores the addresses of the selected first set by selecting the first set by a predetermined number, and stores the number of additional data A second storage unit having a plurality of second sets of additional data counters, the data address storage unit is sequentially searched, and the first address pointed to by the address stored in the data address storage unit is indicated. The first set is searched as a rough position for inserting the additional data by a first algorithm predetermined with reference to the data storage unit in the first set, and then the rough position is searched. From the first set, the data storage position pointed to by the address stored in the next data address storage unit is pointed to, and the additional data is determined by the second algorithm determined in advance. And a search / insert means for counting up the value of the additional data counter in the second set corresponding to the first set as the rough position.
【請求項2】前記追加データカウンターの値が予め決め
られた値になると前記概略位置としての第一の組から前
記次データアドレス格納部に格納されたアドレスを順次
たどり予め決められた数毎に前記第一の組のアドレスを
前記データアドレス格納部に格納するとともに前記追加
データカウンターを初期化する第2記憶部生成手段を備
えたことを特徴とする請求項1記載のソート方式。
2. When the value of the additional data counter reaches a predetermined value, the addresses stored in the next data address storage unit are sequentially traced from the first set as the rough position, and for each predetermined number. 2. The sorting method according to claim 1, further comprising a second storage generating unit that stores the first set of addresses in the data address storage and initializes the additional data counter.
JP4116591A 1992-05-11 1992-05-11 Sort system Withdrawn JPH0793129A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4116591A JPH0793129A (en) 1992-05-11 1992-05-11 Sort system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4116591A JPH0793129A (en) 1992-05-11 1992-05-11 Sort system

Publications (1)

Publication Number Publication Date
JPH0793129A true JPH0793129A (en) 1995-04-07

Family

ID=14690935

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4116591A Withdrawn JPH0793129A (en) 1992-05-11 1992-05-11 Sort system

Country Status (1)

Country Link
JP (1) JPH0793129A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007233554A (en) * 2006-02-28 2007-09-13 National Institute Of Advanced Industrial & Technology Search method of high-speed pattern matching device
JP2013175022A (en) * 2012-02-24 2013-09-05 Seiko Epson Corp Sort circuit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007233554A (en) * 2006-02-28 2007-09-13 National Institute Of Advanced Industrial & Technology Search method of high-speed pattern matching device
JP2013175022A (en) * 2012-02-24 2013-09-05 Seiko Epson Corp Sort circuit

Similar Documents

Publication Publication Date Title
JP2607818B2 (en) Method and apparatus for determining whether a record is stored in a computer system
CN107807982B (en) Consistency checking method and device for heterogeneous database
EP0268373B1 (en) Method and apparatus for determining a data base address
US5257365A (en) Database system with multi-dimensional summary search tree nodes for reducing the necessity to access records
US7062499B2 (en) Enhanced multiway radix tree and related methods
US5819268A (en) Method and system for testing for equality/difference in multiple tables of a database
EP1234258B1 (en) System for managing rdbm fragmentations
CN111143368B (en) Relational database data comparison method and system
US6493706B1 (en) Arrangement for enhancing weighted element searches in dynamically balanced trees
CN104636349A (en) Method and equipment for compression and searching of index data
EP0520232A2 (en) Method and apparatus for saving and retrieving functional results
CN110097581B (en) Method for constructing K-D tree based on point cloud registration ICP algorithm
JP2007034878A (en) Information processing method, information processor, and information processing program
JPH0793129A (en) Sort system
CN111475511A (en) Data storage method, data access method, data storage device, data access device and data access equipment based on tree structure
KR20020001800A (en) Color image processing method
CN113742344A (en) Method and device for indexing power system data
CN111858703B (en) Method and device for counting performance test data of benchmark SQL
CN113495901A (en) Variable-length data block oriented quick retrieval method
US6901396B1 (en) Packed radix search tree implementation
JP3534471B2 (en) Merge sort method and merge sort device
JPH10240741A (en) Managing method for tree structure type data
JP2000090115A (en) Index generating method and retrieval method
CN114969913B (en) Method, system, equipment and medium for instantiating three-dimensional model component
EP4235453A1 (en) Method for creating an index for reporting large-scale variant clusterings

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990803