JPH07191826A - Sorting method for list body structure - Google Patents

Sorting method for list body structure

Info

Publication number
JPH07191826A
JPH07191826A JP5333528A JP33352893A JPH07191826A JP H07191826 A JPH07191826 A JP H07191826A JP 5333528 A JP5333528 A JP 5333528A JP 33352893 A JP33352893 A JP 33352893A JP H07191826 A JPH07191826 A JP H07191826A
Authority
JP
Japan
Prior art keywords
list structure
address
index
item
registered
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.)
Pending
Application number
JP5333528A
Other languages
Japanese (ja)
Inventor
Shige Masuda
樹 増田
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 Software Shizuoka Ltd
Original Assignee
NEC Software Shizuoka Ltd
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 Software Shizuoka Ltd filed Critical NEC Software Shizuoka Ltd
Priority to JP5333528A priority Critical patent/JPH07191826A/en
Publication of JPH07191826A publication Critical patent/JPH07191826A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To provide the method for shortening exchanging processing to sort a list body structure. CONSTITUTION:The addresses of the list body structure are successively temporarily registered on a repetition table provided with exponents corresponding to sort item values at respective items. On the other hand, the sort item values of the same value are linked and registered inside the start and end addresses.of the item of the same exponent while switching the linkage. Then, processing from the head of the list body structure to the end is performed while utilizing the exponents of the repetition table and by switching the list body structure, sort processing is shortened.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、連接されているリス
ト構造体をそれのソート項目値によってソートするリス
ト構造体のソート方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a list structure sorting method for sorting linked list structures according to their sort item values.

【0002】[0002]

【従来の技術】連接されたリスト構造体の各々を特定の
ソート項目値に従いソートする場合がある。例えばリス
ト構造化された学生のデータをある成績順に並び換えて
ソートする場合がそれの例である。
2. Description of the Related Art Each of linked list structures may be sorted according to a specific sort item value. For example, an example is a case where the student data having a list structure is sorted and sorted in a certain grade order.

【0003】従来のリスト構造体のソート方法を図面を
参照して説明する。従来の方法の手順を示す図7を参照
し、図4に例示する連接されたリスト構造体をソートす
る。
A conventional list structure sorting method will be described with reference to the drawings. Referring to FIG. 7 showing the procedure of the conventional method, the concatenated list structure illustrated in FIG. 4 is sorted.

【0004】先ず、図4において先頭のリスト構造体2
20は先頭アドレスであることを示すアドレス210
と、リスト構造体自身を格納するアドレス221と、次
のリスト構造体のアドレス222と、ソート項目値22
3と、によって表される。
First, the list structure 2 at the head of FIG.
An address 210 indicating that 20 is the start address
, An address 221 for storing the list structure itself, an address 222 for the next list structure, and a sort item value 22.
3 and.

【0005】また、リスト構造体230,240,25
0,260,270はそれぞれリスト構造体自身を格納
するアドレスと次のリスト構造体のアドレスとソート項
目値によって表され、連接された状況を図4に示す。従
来のソート方法を示す図7を参照し、ソートを説明する
図8を援用して、従来のソート方法を説明する。
Further, the list structures 230, 240, 25
0, 260, 270 are respectively represented by the address storing the list structure itself, the address of the next list structure, and the sort item value, and the connected state is shown in FIG. A conventional sorting method will be described with reference to FIG. 7 showing a conventional sorting method and with reference to FIG. 8 for explaining sorting.

【0006】図9において項番210,220,23
0,240,250,260,270は図4の項番21
0,220,230,240,250,260,270
と同一のリスト構造体を示す。上述の連接されたリスト
構造体210乃至270を先頭から連接を辿り、ソート
を開始すると、先ずソート有無に無を設定する(図7の
ステップ71)。次にリスト構造体の先頭アドレスが示
すリスト構造体220を参照する。リスト構造体220
の次のリスト構造体のアドレス222が示すリスト構造
体230を見つける。
In FIG. 9, item numbers 210, 220 and 23
0, 240, 250, 260 and 270 are item numbers 21 in FIG.
0,220,230,240,250,260,270
Shows the same list structure as. When the linked list structures 210 to 270 are linked from the beginning and sorting is started, first, no sorting is set for the presence or absence of sorting (step 71 in FIG. 7). Next, the list structure 220 indicated by the start address of the list structure is referred to. List structure 220
The list structure 230 indicated by the address 222 of the list structure next to is found.

【0007】図8(a)を参照すると、リスト構造体2
20の先頭アドレスの「100」が指すリスト構造体2
20を一件目として読込み(ステップ72)、更に、次
のリスト構造体のアドレス222の「110」が指すリ
スト構図体230を読込む(ステップ73)。
Referring to FIG. 8A, the list structure 2
List structure 2 pointed to by "100" at the start address of 20
20 is read as the first item (step 72), and further, the list composition 230 pointed to by "110" of the address 222 of the next list structure is read (step 73).

【0008】リスト構造体220とリスト構造体230
の2つのソート項目値を比較しソート項目値が正順でな
く、逆順のためソートが必要なときリスト構造体の付け
換へを行う(ステップ75)。
List structure 220 and list structure 230
The two sort item values are compared, and when the sort item values are not in the forward order but are in the reverse order, the list structure is replaced (step 75).

【0009】図8(b)は、リスト構造体を付け換へた
後を示し、リスト構造体の先頭アドレス210に「11
0」、リスト構造体220の次の構造体のアドレスの
「120」、リスト構造体230の次の構造体のアドレ
スの「100」が設定されている。リスト構造体の付け
換へを行なった後、ソート有無に有を設定する(ステッ
プ76)。次に連接されているリスト構造体を参照し
(ステップ77)、リスト構造体の終端になるまで逆順
を正順に付け換えるステップ74乃至78を繰り返す
(ステップ78のN)。
FIG. 8B shows the state after the list structure is replaced, and the start address 210 of the list structure is set to "11".
“0”, the address “120” of the structure next to the list structure 220, and the address “100” of the structure next to the list structure 230 are set. After the list structure is replaced, the presence / absence of sort is set to "Yes" (step 76). Next, the linked list structures are referred to (step 77), and steps 74 to 78 for changing the reverse order to the normal order are repeated until the end of the list structure is reached (N in step 78).

【0010】図8(c)は、リスト構造体240と次に
連接されているリスト構造体250を読込み参照してい
る状況を示す。
FIG. 8C shows a situation in which the list structure 240 and the list structure 250 connected next to the list structure 240 are read and referenced.

【0011】図8(d)は、リスト構造体240とリス
ト構造体250の付け換へ後を示す。リスト構造体22
0の次の構造体のアドレスに「130」、リスト構造体
240の次のリスト構造体のアドレスに「140」、リ
スト構造体250の次のリスト構造体のアドレスに「1
20」が付け換によってそれぞれ登録されている。
FIG. 8D shows the state after the replacement of the list structure 240 and the list structure 250. List structure 22
The address of the structure next to 0 is “130”, the address of the list structure next to the list structure 240 is “140”, and the address of the list structure next to the list structure 250 is “1”.
20 ”is registered by replacement.

【0012】リスト構造体の連接の終端に達したとき
(ステップ78のY)、ソート有無の判定が無になるま
でステップ71乃至79を繰り返す。(ステップ79の
N)。
When the end of the concatenation of the list structures is reached (Y in step 78), steps 71 to 79 are repeated until the presence / absence of sorting is determined. (N in step 79).

【0013】図8(e)は、リスト構造体の先頭アドレ
ス210から順次、リスト構造体を辿り、リスト構造体
の終端に達したとき、付け換えが完了していない途中の
状況を示している。図8(f)は、図8(e)の状況か
らリスト構造体を順次、辿ってリスト構造体の終端に達
したとき、付け換えを完了していない途中の状況を示し
ている。図8(g)はリスト構造体を順次に辿ってい
き、ソート有無が無になり、リスト構造体の終端に達し
たとき、付け換えによるソートの完了を示している。
FIG. 8E shows a situation in which the replacement is not completed when the list structure is sequentially traced from the head address 210 of the list structure and the end of the list structure is reached. . FIG. 8F shows a situation where the replacement is not completed when the end of the list structure is reached by sequentially tracing the list structure from the situation of FIG. 8E. FIG. 8G shows the completion of sorting by replacement when the list structure is sequentially traced, the presence / absence of sorting is eliminated, and the end of the list structure is reached.

【0014】[0014]

【発明が解決しようとする課題】従来のリスト構造体の
ソート方法において、リスト構造体の連接を繰り返し辿
ってソート項目値が逆順の個所を正順に付換えるため、
リスト構造体の総数をN個とした時、N個のリスト構造
体を最初から終了まで参照し、リスト構造体の付け換へ
の最大がN回であるから、Nの自乗のオーダの回数の付
け換えになり、コンピュータは多大な実行ステップと処
理時間を必要とする。
In the conventional method for sorting a list structure, since the concatenation of the list structures is repeatedly traced and the places where the sort item values are in the reverse order are rearranged,
When the total number of list structures is N, the N list structures are referenced from the beginning to the end, and the maximum number of replacements of the list structures is N times. In other words, the computer requires a great deal of execution steps and processing time.

【0015】[0015]

【課題を解決するための手段】この発明の目的は、連接
されているリスト構造体をソート項目値の順に付け換え
てソートする処理を短縮する方法の提供である。
SUMMARY OF THE INVENTION An object of the present invention is to provide a method for shortening the sorting process by reordering concatenated list structures in the order of sort item values.

【0016】そのため、連接先を指す次のリスト構造体
のアドレスおよびソート項目値をデータとして持つリス
ト構造体を前記ソート項目値の順にソートするリスト構
造体のソート方法において、リスト構造体の下限値から
上限値までのソート項目値に対応する指標を有する項目
のそれぞれに開始アドレスと終端アドレスを登録する繰
り返しテーブルを作成する初期化手順と、リスト構造体
を先頭から順次に連接を辿るとき、リスト構造体のソー
ト項目値に対応する指標の項目に開始アドレスおよび終
端アドレスが登録されていない場合、リスト構造体自身
を格納するアドレスを指標の項目の開始アドレスおよび
終端アドレスに登録し、また指標の項目に開始アドレス
および終端アドレスが既に登録されている場合、指標の
項目の終端アドレスが指すリスト構造体を参照し、指標
の項目に既に登録されていたリスト構造体の次のリスト
構造体のアドレスに参照しているリスト構造体自身を格
納するアドレスを登録し、指標の項目の終端アドレス
に、参照しているリスト構造体自身を格納するアドレス
を登録し、連接を終端まで辿って繰り返しテーブルの指
標の項目にリスト構造体自身を格納するアドレスを開始
アドレスおよび終端アドレスにそれぞれ登録する繰り返
しテーブル作成手順と、繰り返しテーブルの各指標の項
目にアドレスが登録されているか否かを先頭の指標から
順に判定し、アドレスが登録されている最初の指標の項
目の開始アドレスを先頭アドレスに登録し、先頭アドレ
スが指すリスト構造体を参照し、指標の項目から次にア
ドレスが登録されている指標の項目の開始アドレスを参
照しているリスト構造体の次のリスト構造体のアドレス
に登録し、指標の項目の終端アドレスが指すリスト構造
体を参照し、前記指標の項目から次にアドレスが登録さ
れている指標の項目に対し、それの開始アドレスを参照
しているリスト構造体の次のリスト構造体のアドレスに
登録し、繰り返しテーブルの指標の終りまで辿り、指標
の終りのとき、最終に参照したリスト構造体の次のリス
ト構造体のアドレスに終端を登録するリスト構造対作成
手順と、を含む。
Therefore, in the list structure sorting method of sorting the list structure having, as data, the address of the next list structure indicating the connection destination and the sort item value, in the sorting method of the list structure, the lower limit value of the list structure To the upper limit, the initialization procedure that creates a repeating table that registers the start address and end address for each item that has an index corresponding to the sort item value, and when the list structure is sequentially linked from the beginning, the list If the start and end addresses are not registered in the index item corresponding to the sort item value of the structure, the address that stores the list structure itself is registered in the start and end addresses of the index item, and the index If the start address and end address are already registered in the item, the end address of the index item Refer to the list structure pointed to by, register the address that stores the referenced list structure itself to the address of the list structure next to the list structure already registered in the index item, and Register the address that stores the referenced list structure itself in the end address, trace the concatenation to the end, and register the address that stores the list structure in the index item of the repeat table in the start address and end address, respectively. Repeat table creation procedure and determine whether or not an address is registered in each index item of the repetition table in order from the first index, and set the start address of the first index item in which the address is registered to the first address. Register, refer to the list structure pointed to by the first address, and change from the index item to the index item whose address is registered next. The start address is registered in the address of the list structure next to the reference structure, the list structure pointed to by the end address of the index item is referenced, and the address is registered next from the index item. For the index item, register it at the address of the list structure next to the list structure that refers to its start address, trace to the end of the index in the repetition table, and at the end of the index, refer to the last list A list structure pair creating procedure for registering an end at the address of the list structure next to the structure.

【0017】[0017]

【実施例】この発明を図面によって説明する。DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described with reference to the drawings.

【0018】この発明の一実施例の手順を示す流れ図1
を参照し、実施例の説明をする。
Flowchart 1 showing the procedure of one embodiment of the present invention
The embodiment will be described with reference to FIG.

【0019】先ず、図4には、連接されたリスト構造体
を示し、連接の先頭を示すリスト構造体の先頭アドレス
210と、リスト構造体220は自身を格納するアドレ
ス221と次のリスト構造体のアドレス222とソート
項目値223と、によって表される。リスト構造体23
0,240,250,260,270はそれぞれリスト
構造体自身のアドレスと次のリスト構造体のアドレスと
ソート項目値とによって表される。
First, FIG. 4 shows a concatenated list structure. The start address 210 of the list structure indicating the beginning of the concatenation, the list structure 220 stores an address 221 for storing itself, and the next list structure. Address 222 and sort item value 223. List structure 23
0, 240, 250, 260 and 270 are respectively represented by the address of the list structure itself, the address of the next list structure and the sort item value.

【0020】図5は、リスト構造体をソート項目値の順
に指標を対応づけて登録する繰り返しテーブル30であ
る。繰り返しテーブル30は指標31、ならびに開始ア
ドレス32と終端アドレス33を登録する項目を有す
る。
FIG. 5 is a repeating table 30 in which the list structure is registered in association with the indexes in the order of the sort item values. The repetition table 30 has items for registering an index 31, and a start address 32 and an end address 33.

【0021】この実施例の手順を説明する流れ図6を参
照すると、項番210,220,230,240,25
0,260,270は図4の項番210,220,23
0,240,250,260,270と同一のリスト構
造体を示し、項番30は図5の項番30と同一の繰り返
しテーブルを示す。
Referring to the flow chart 6 for explaining the procedure of this embodiment, item numbers 210, 220, 230, 240 and 25 are shown.
0, 260, 270 are item numbers 210, 220, 23 in FIG.
0, 240, 250, 260, 270 shows the same list structure, and item number 30 shows the same repetition table as item number 30 of FIG.

【0022】この実施例の手順を示す流れ図1と、流れ
図1の細部手順を示す図2,3を援用し、実施例の動作
を説明する。
The operation of the embodiment will be described with reference to the flow chart 1 showing the procedure of this embodiment and FIGS. 2 and 3 showing the detailed procedure of the flow chart 1.

【0023】先ず、リスト構造体のソート項目値の下限
値から上限値までの各値に対応する指標と項目を設定
し、繰り返しテーブル30を作成する初期化を行う(図
1のステップ)。次に、リスト構造体の先頭アドレス2
10が示すリスト構造体220を一件目として読込む
(ステップ2)。リスト構造体220のソート項目値
「4」に対応する繰り返しテーブル30の指標「4」の
項目に開始アドレスおよび終端アドレスが未設定のとき
(ステップ3のN)、繰り返しテーブル30の指標
「4」の項目にアドレス登録を行う(ステップ4)。
First, the index and the item corresponding to each value from the lower limit value to the upper limit value of the sort item value of the list structure are set, and initialization is performed to create the repeating table 30 (step of FIG. 1). Next, the start address 2 of the list structure
The list structure 220 indicated by 10 is read as the first item (step 2). When the start address and the end address are not set in the item of the index “4” of the repeating table 30 corresponding to the sort item value “4” of the list structure 220 (N in step 3), the index “4” of the repeating table 30. The address is registered in the item (step 4).

【0024】図6(a)は、リスト構造体の先頭アドレ
ス210の「100」が示すリスト構造体220のソー
ト項目値「4」に対応する繰り返しテーブル30の指標
「4」の項目の開始アドレス32および終端アドレス3
3に、リスト構造体220のアドレス「100」を登録
している。
FIG. 6A shows the start address of the item of index "4" of the repetition table 30 corresponding to the sort item value "4" of the list structure 220 indicated by "100" of the start address 210 of the list structure. 32 and end address 3
The address “100” of the list structure 220 is registered in No. 3.

【0025】次に、ソート項目値に対応する指標の項目
に開始アドレスおよび終端アドレスが登録済のとき(ス
テップ3のY)、リスト構造体の付け換処理1を行う
(ステップ5)。付け換処理1を示す流れ図2を参照
し、図6(b)を説明すると、リスト構造体240の次
のリスト構造体のアドレス「130」が指すリスト構造
体250のソート項目値「3」が示す繰り返しテーブル
30の指標「3」の開始アドレスおよび終端アドレスに
アドレス「110」が登録済であるため(ステップ3の
Yおよびステップ5a)、指標「3」の終端アドレス
「110」が指すリスト構造体220の次のリスト構造
体のアドレスにリスト構造体250を格納するアドレス
「130」を登録し(ステップ5b)、リスト構造体2
50のソート項目値「3」が示す指標「3」の終端アド
レスにリスト構造体250のアドレス「130」を登録
する(ステップ5c)。リスト構造体を順次に辿り(ス
テップ6)、繰り返しテーブル30の各指標の項目にア
ドレス登録し、最終のリスト構造体の次のリスト構造体
のアドレスが終端を示すまで繰り返す(ステップの
N)。
Next, when the start address and the end address have been registered in the item of the index corresponding to the sort item value (Y in step 3), the list structure replacement process 1 is performed (step 5). Referring to FIG. 6B with reference to the flowchart 2 showing the replacement process 1, the sort item value “3” of the list structure 250 pointed to by the address “130” of the list structure next to the list structure 240 is Since the address “110” has already been registered as the start address and the end address of the index “3” in the repeating table 30 shown (Y in step 3 and step 5a), the list structure pointed to by the end address “110” of the index “3” The address "130" for storing the list structure 250 is registered in the address of the list structure next to the body 220 (step 5b), and the list structure 2
The address "130" of the list structure 250 is registered in the end address of the index "3" indicated by the sort item value "3" of 50 (step 5c). The list structure is sequentially traced (step 6), the address is registered in each index item of the repetition table 30, and the process is repeated until the address of the list structure next to the final list structure indicates the end (step N).

【0026】図6(c)および(d)は、リスト構造体
に対する繰り返しテーブル30にアドレス登録がすべて
終了した状態を示している。ソート項目値に対しリスト
構造体が単一しかないリスト構造体220,240,2
60270については、リスト構造体のソート項目値に
対応する指標の項目の開始アドレスおよび終端アドレス
それぞれにリスト構造体自身を格納するアドレスが登録
される。
FIGS. 6 (c) and 6 (d) show a state in which all the addresses have been registered in the repetition table 30 for the list structure. List structure 220, 240, 2 having only one list structure for sort item values
As for 60270, the addresses for storing the list structure itself are registered in the start address and the end address of the index item corresponding to the sort item value of the list structure.

【0027】ソート項目値に対応するリスト構造体が複
数あるリスト構造体230,250については、リスト
構造体230の次のリスト構造体のアドレスにリスト構
造体250を格納するアドレス「130」が登録され、
ソート項目値「3」の開始アドレスにはリスト構造体2
30を格納するアドレス「110」が、終端アドレスに
はリスト構造体250を格納するアドレス「130」が
それぞれ登録されている。
For the list structures 230 and 250 having a plurality of list structures corresponding to sort item values, the address "130" for storing the list structure 250 is registered at the address of the list structure next to the list structure 230. Is
At the start address of sort item value "3", list structure 2
The address "110" for storing 30 and the address "130" for storing the list structure 250 are registered in the end address.

【0028】図6(d)に示す繰り返しテーブル30は
アドレス登録が終了した状態で、次に指標に「1」を登
録し(ステップ8)、繰り返しテーブル30の指標
「1」にある開始アドレを先頭アドレスとして登録する
(ステップ11)。
In the repetition table 30 shown in FIG. 6D, with the address registration completed, "1" is then registered in the index (step 8), and the start address in the index "1" of the repetition table 30 is registered. Register as the top address (step 11).

【0029】図6(e)は、繰り返しテーブル30の指
標「1」の開始アドレスと終端アドレスに先頭アドレス
「140」が登録されている。そして、終端アドレスが
指すリスト構造体を参照する(ステップ12)。更に、
指標「1」を「2」に更新し(ステップ13)、繰り返
しテーブル30の指標「2」にアドレスが登録されてい
るので(ステップ14のY)、リスト構造体付け換処理
2を行う(ステップ15)。リスト構造体付け換処理2
を示す流れ図3を参照し、リスト構造体の付け換を説明
すと、繰り返しテーブルの指標「2」の終端アドレス
「150」が指すリスト構造体270の次のリスト構造
体のアドレスに指標「3」の開始アドレス「110」を
設定する(ステップ15a)。そして、終端アドレスが
指すリスト構造体を参照する(ステップ15b)。繰り
返しテーブル30の指標が終わりでないとき(ステップ
16のY)、指標を更新し(ステップ13)、更新した
指標の次の指標の開始アドレスおよび終端アドレスの付
け換処理2を行う(ステップ15)。繰り返しテーブル
の指標を順次辿って、指標の最終に達したとき(ステッ
プ16のN)、最終に参照したリスト構造体の次のリス
ト構造体のアドレスに終端を登録する(ステップ1
7)。
In FIG. 6E, the head address “140” is registered in the start address and end address of the index “1” of the repetition table 30. Then, the list structure pointed to by the end address is referenced (step 12). Furthermore,
The index "1" is updated to "2" (step 13), and since the address is registered in the index "2" of the repetition table 30 (Y of step 14), the list structure replacement processing 2 is performed (step). 15). List structure replacement processing 2
The replacement of the list structure will be described with reference to the flow chart 3 of FIG. 3, in which the index "3" is added to the address of the list structure 270 next to the end address "150" of the index "2" of the repetition table. The start address "110" of "" is set (step 15a). Then, the list structure pointed to by the end address is referenced (step 15b). When the index of the repetition table 30 is not the end (Y of step 16), the index is updated (step 13), and the start address and end address replacement processing 2 of the index next to the updated index is performed (step 15). When the end of the index is reached (N in step 16), the end of the list structure is registered at the address of the list structure next to the last referenced list structure (step 1).
7).

【0030】図6(g)は繰り返しテーブルの指標
「5」が示す終端アドレス「120」が指すリスト構造
体240の次のリスト構造体のアドレスに終端を設定し
ている。
In FIG. 6 (g), the end is set to the address of the list structure next to the list structure 240 pointed to by the end address "120" indicated by the index "5" of the repetition table.

【0031】図6(h)はリスト構造体のソートを完了
し、ソート項目値順に付け換えが完了している状況を示
している。リスト構造体の先頭アドレス210の「14
0」がリスト構造体260を指し、リスト構造体260
の次のリストと構造体のアドレス「150」がリスト構
造体270を指し、各リスト構造体のソート項目値の昇
順にリスト構造体が付け換へられて連接し、リスト構造
体240の次のリスト構造体のアドレスに終端が格納さ
れている。
FIG. 6 (h) shows a situation in which the list structures have been sorted and the sorting has been completed in the order of the sorted item values. "14" at the start address 210 of the list structure
0 ”points to the list structure 260, and the list structure 260
The address "150" of the next list and structure points to the list structure 270, the list structures are replaced and connected in the ascending order of the sort item values of each list structure, and The end is stored at the address of the list structure.

【0032】[0032]

【発明の効果】以上説明したようにこの発明によれば、
ソート項目値に対応する繰り返しテーブルの相対的位置
に、リスト構造体のアドレスを一旦登録し、リスト構造
体の付け換えを繰り返しテーブルを利用して行うため、
リスト構造体の数をN個とした時、リスト構造体を登録
するため先頭から終端まで辿る回数は1回、リスト構造
体の付け換え個所は最大でN個所であるから、Nのオー
ダで付け換ができる。
As described above, according to the present invention,
Since the address of the list structure is temporarily registered at the relative position of the repetition table corresponding to the sort item value and the list structure is replaced using the repetition table,
When the number of list structures is N, the number of times from the beginning to the end is 1 to register the list structure, and the number of replacement parts of the list structure is N at the maximum, so the order is N. Can be exchanged.

【0033】従来の方法に比較して、コンピュータ上で
の実行ステップを大幅に削減する。
Compared with the conventional method, the execution steps on the computer are greatly reduced.

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

【図1】この発明の一実施例の手順を示す流れ図であ
る。
FIG. 1 is a flow chart showing a procedure of an embodiment of the present invention.

【図2】図1の付け換処理1を示す流れ図である。FIG. 2 is a flowchart showing a replacement process 1 of FIG.

【図3】図1の付け換処理2を示す流れ図である。FIG. 3 is a flowchart showing a replacement process 2 of FIG.

【図4】連接したリスト構造体を例示する図である。FIG. 4 is a diagram illustrating a concatenated list structure.

【図5】繰り返しテーブルを例示する図である。FIG. 5 is a diagram illustrating a repetition table.

【図6】子図(a)乃至(b)は、それぞれリスト構造
体の付け換処理および付け換処理2を説明する図であ
る。
6A and 6B are diagrams for explaining a list structure replacement process and a replacement process 2, respectively.

【図7】従来のリスト構造体のソート方法を示す流れ図
である。
FIG. 7 is a flowchart showing a conventional method for sorting a list structure.

【図8】子図(a)乃至(g)は、それぞれ従来のソー
ト方法を説明する図である。
8A to 8G are diagrams for explaining a conventional sorting method.

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

210 リスト構造体の先頭アドレス 220,230,240,250,260,270
リスト構造体 221 リスト構造体のアドレス 222 次のリスト構造体のアドレス 223 リスト構造体のソート項目値 30 繰り返しテーブル 31 繰り返しテーブルの指標 32 開始アドレス 33 終端アドレス
210 start address of list structure 220, 230, 240, 250, 260, 270
List structure 221 List structure address 222 Next list structure address 223 List structure sort item value 30 Repeating table 31 Repeating table index 32 Start address 33 End address

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 連接先を指す次のリスト構造体のアドレ
スおよびソート項目値をデータとして持つリスト構造体
を前記ソート項目値の順にソートするリスト構造体のソ
ート方法において、 リスト構造体の下限値から上限値までのソート項目値に
対応する指標を有する項目のそれぞれに開始アドレスと
終端アドレスを登録する繰り返しテーブルを作成する初
期化手順と、 リスト構造体を先頭から順次に連接を辿るとき、リスト
構造体のソート項目値に対応する指標の項目に開始アド
レスおよび終端アドレスが登録されていない場合、リス
ト構造体自身を格納するアドレスを指標の項目の開始ア
ドレスおよび終端アドレスに登録し、また指標の項目に
開始アドレスおよび終端アドレスが既に登録されている
場合、指標の項目の終端アドレスが指すリスト構造体を
参照し、指標の項目に既に登録されていたリスト構造体
の次のリスト構造体のアドレスに参照しているリスト構
造体自身を格納するアドレスを登録し、指標の項目の終
端アドレスに、参照しているリスト構造体自身を格納す
るアドレスを登録し、連接を終端まで辿って繰り返しテ
ーブルの指標の項目にリスト構造体自身を格納するアド
レスを開始アドレスおよび終端アドレスにそれぞれ登録
する繰り返しテーブル作成手順と、 繰り返しテーブルの各指標の項目にアドレスが登録され
ているか否かを先頭の指標から順に判定し、アドレスが
登録されている最初の指標の項目の開始アドレスを先頭
アドレスに登録し、先頭アドレスが指すリスト構造体を
参照し、指標の項目から次にアドレスが登録されている
指標の項目の開始アドレスを参照しているリスト構造体
の次のリスト構造体のアドレスに登録し、指標の項目の
終端アドレスが指すリスト構造体を参照し、前記指標の
項目から次にアドレスが登録されている指標の項目に対
し、それの開始アドレスを参照しているリスト構造体の
次のリスト構造体のアドレスに登録し、繰り返しテーブ
ルの指標の終りまで辿り、指標の終りのとき、最終に参
照したリスト構造体の次のリスト構造体のアドレスに終
端を登録するリスト構造体作成手順と、 を含むことを特徴とするリスト構造体のソート方法。
1. A list structure sorting method for sorting a list structure having, as data, an address and a sort item value of a next list structure pointing to a concatenation destination, in a sort method of a list structure, a lower limit value of the list structure. To the upper limit, the initialization procedure that creates a repeating table that registers the start address and end address for each item that has an index corresponding to the sort item value, and when the list structure is sequentially linked from the beginning, the list If the start and end addresses are not registered in the index item corresponding to the sort item value of the structure, the address that stores the list structure itself is registered in the start and end addresses of the index item, and the index If the start address and end address are already registered in the item, the end address of the index item points Register the address that stores the referenced list structure itself to the address of the list structure next to the list structure that was already registered in the index item by referring to the list structure, and the end address of the index item , Register the address that stores the referenced list structure itself, trace the concatenation to the end, and register the address that stores the list structure itself in the index item of the repeat table at the start address and end address, respectively. The table creation procedure and whether or not an address is registered in each index item of the repetition table are determined in order from the first index, and the start address of the first index item in which the address is registered is registered in the first address. , Refer to the list structure pointed to by the start address, and add the start address of the index item whose address is registered next from the index item. The index that is registered at the address of the list structure next to the list structure that refers to the index, refers to the list structure pointed to by the end address of the index item, and has the address registered next from the index item. For the item of, the start address of the list structure is registered at the address of the list structure next to the list structure, and the list structure is traced to the end of the index in the repetition table, and at the end of the index, the list structure last referenced A method for sorting a list structure, characterized by including a procedure for creating a list structure that registers an end at the address of the next list structure in the field, and.
JP5333528A 1993-12-27 1993-12-27 Sorting method for list body structure Pending JPH07191826A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5333528A JPH07191826A (en) 1993-12-27 1993-12-27 Sorting method for list body structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5333528A JPH07191826A (en) 1993-12-27 1993-12-27 Sorting method for list body structure

Publications (1)

Publication Number Publication Date
JPH07191826A true JPH07191826A (en) 1995-07-28

Family

ID=18267055

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5333528A Pending JPH07191826A (en) 1993-12-27 1993-12-27 Sorting method for list body structure

Country Status (1)

Country Link
JP (1) JPH07191826A (en)

Similar Documents

Publication Publication Date Title
JP2694122B2 (en) How to automatically test software applications
JPS61223941A (en) Method for storing and retrieving chemical structure
EP1415248A1 (en) Method for fast searching and analyzing inter-relations between patents from a patent database
JP4136594B2 (en) Data processing method and data processing program
JPH07191826A (en) Sorting method for list body structure
WO2005043409A1 (en) Table-formatted data connection method, connection device, and program
JP2752762B2 (en) Node matching processing method
JPH01280831A (en) Assisting method for standardization of intra-program data name
JP3516283B2 (en) Character code conversion device and character code conversion method
JP2564881B2 (en) Bit string comparison method
JPS6120119A (en) Information input tablet
JPH05324556A (en) Already executed operation canceller
JP2899427B2 (en) Test pattern creation device
JPS6227836A (en) Storing system for document data
JPH01260580A (en) Graphic input conversion device
JPH0643836Y2 (en) Character output device
JPH0736751A (en) Relational data base system
JPS58121484A (en) Context analyzing circuit
JPH01306934A (en) System for preparing data base for testing
Harkow et al. Selection Sets and Nongraphical Entities
JPH0969130A (en) Method for constituting document entry manual
JPH0465405B2 (en)
JPH0652329A (en) Linear plotting and polygonal painting-out device
JPS58109961A (en) Mark tabulation computer
JPH01300304A (en) Position defining method for parts hole

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20000606