JPH07281871A - Data interchanging method - Google Patents

Data interchanging method

Info

Publication number
JPH07281871A
JPH07281871A JP7568194A JP7568194A JPH07281871A JP H07281871 A JPH07281871 A JP H07281871A JP 7568194 A JP7568194 A JP 7568194A JP 7568194 A JP7568194 A JP 7568194A JP H07281871 A JPH07281871 A JP H07281871A
Authority
JP
Japan
Prior art keywords
data
memory area
address
pointer
pointers
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
JP7568194A
Other languages
Japanese (ja)
Inventor
Masaki Arima
正木 有馬
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP7568194A priority Critical patent/JPH07281871A/en
Publication of JPH07281871A publication Critical patent/JPH07281871A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To speed up a sorting process, etc., for data by making the frequency of the changing of a pointer, indicating a connection destination of the data, smaller than before even when the frequency of interchanging of the data is large. CONSTITUTION:In addition to a data memory area K in list structure wherein front painters and rear pointers indicating the mutual connection relation of respective data are added, a list memory area L is secured, only address painters indicating the addresses of the data memory area K where the data are stored are previously stored in the list memory area, and when the connection order of the data is changed, the order of the address pointers in the list memory area L is changed corresponding to the connection order of data after alteration and, the address pointers after the replacement is referred to and the contents of the front pointers and rear pointers in the data memory area K are altered.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、データのソート等に利
用するデータ交換方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data exchange method used for sorting data.

【0002】[0002]

【従来の技術】図2は、従来のデータ交換方法を説明す
るためのメモリマップ図である。
2. Description of the Related Art FIG. 2 is a memory map diagram for explaining a conventional data exchange method.

【0003】同図(a)において、A1〜A6番地はメモ
リのアドレスであり、D1〜D6はデータ、A0〜A7
は各データD1〜D6の前後の接続関係を示す前方ポイ
ンタおよび後方ポインタである。
In FIG. 1A, addresses A1 to A6 are memory addresses, D1 to D6 are data, and A0 to A7.
Is a front pointer and a rear pointer indicating the connection relationship before and after each data D1 to D6.

【0004】各データD1〜D6は、ここでは、D1→
D2→D3→D4→D5→D6の順に一定の関連性をも
って接続された、いわゆるデータチェーンを構成してい
る。
Here, each of the data D1 to D6 is D1 →
A so-called data chain is connected in the order of D2 → D3 → D4 → D5 → D6 with a certain relation.

【0005】すなわち、A1番地に着目すると、このA
1番地には、データD1、およびこのデータD1を挟む
前後にデータD1の接続先を示す前方ポインタA0と後
方ポインタA2がそれぞれ格納されている。
That is, focusing on the address A1, this A
At address 1, data D1 and a front pointer A0 and a rear pointer A2 indicating the connection destination of the data D1 before and after sandwiching the data D1 are stored.

【0006】前方ポインタA0は、データチェーンを構
成する一つのデータD1に対して前方に接続されるデー
タ(ここでは存在せず)のアドレス位置を示す。また、後
方ポインタA2は、このデータD1に対して後方に接続
されるデータD2のアドレス位置を示す。
The forward pointer A0 indicates an address position of data (not present here) connected forward with respect to one data D1 forming the data chain. The backward pointer A2 indicates the address position of the data D2 connected backward with respect to this data D1.

【0007】同様に、A2番地に着目すると、このA2
番地には、データD2、およびこのデータデータD2を
挟む前後にデータD2の接続先を示す前方ポインタA1
と後方ポインタA3がそれぞれ格納されている。
Similarly, focusing on the address A2, this A2
At the address, the data D2 and the front pointer A1 indicating the connection destination of the data D2 before and after sandwiching the data D2
And the backward pointer A3 are stored respectively.

【0008】前方ポインタA1は、データチェーンを構
成する一つのデータD2に対して前方に接続されるデー
タD1のアドレス位置を示す。また、後方ポインタA3
は、このデータD2に対して後方に接続されるデータD
3のアドレス位置を示す。
The forward pointer A1 indicates the address position of the data D1 connected forward with respect to one data D2 forming the data chain. Also, the backward pointer A3
Is the data D connected to the rear of this data D2.
3 shows the address position of 3.

【0009】以下、A3〜A6番地の各データD3〜D
6についても、 以下、A3〜A6番地の各データD3
〜D6についても、前方ポインタと後方ポインタとによ
って、相互の接続関係が規定されている。
Hereinafter, each data D3 to D at addresses A3 to A6
As for 6 as well, each data D3 of addresses A3 to A6 will be described below.
Also for D6, the mutual connection relationship is defined by the front pointer and the rear pointer.

【0010】同図(b)は、同図(a)のデータD1〜D6の
接続順序を一部変更した後の状態を示している。
FIG. 2B shows a state after the connection order of the data D1 to D6 in FIG. 1A is partially changed.

【0011】同図(b)において、A1〜A6番地はメモ
リのアドレスであり、D1〜D6はデータ、A0〜A7
は各データD1〜D6の前後の接続関係を示す前方ポイ
ンタおよび後方ポインタである。
In FIG. 1B, addresses A1 to A6 are memory addresses, D1 to D6 are data, and A0 to A7.
Is a front pointer and a rear pointer indicating the connection relationship before and after each data D1 to D6.

【0012】各データD1〜D6は、ここでは、D1→
D5→D3→D4→D2→D6の順に一定の関連性をも
って接続されている。
Each of the data D1 to D6 is, here, D1 →
D5 → D3 → D4 → D2 → D6 are connected in this order with a certain relation.

【0013】すなわち、A1番地に着目すると、このA
1番地には、データD1、およびこのデータD1を挟む
前後にデータD1の接続先を示す前方ポインタA0と後
方ポインタA5がそれぞれ格納されている。
That is, focusing on the address A1, this A
At address 1, data D1 and a front pointer A0 and a rear pointer A5 indicating the connection destination of the data D1 before and after sandwiching the data D1 are stored, respectively.

【0014】前方ポインタA0は、データチェーンを構
成する一つのデータD1に対して前方に接続されるデー
タ(ここでは存在せず)のアドレス位置を示す。また、後
方ポインタA5は、このデータD1に対して後方に接続
されるデータD5のアドレス位置を示す。
The forward pointer A0 indicates an address position of data (not present here) connected forward with respect to one data D1 forming the data chain. The backward pointer A5 indicates the address position of the data D5 connected backward with respect to the data D1.

【0015】同様に、A2番地に着目すると、このA2
番地には、データD2、およびこのデータデータD2を
挟む前後にデータD2の接続先を示す前方ポインタA4
と後方ポインタA6がそれぞれ格納されている。
Similarly, focusing on the address A2, this A2
The address is data D2 and a forward pointer A4 indicating a connection destination of the data D2 before and after sandwiching the data D2.
And a backward pointer A6 are stored respectively.

【0016】前方ポインタA4は、データチェーンを構
成する一つのデータD2に対して前方に接続されるデー
タD4のアドレス位置を示す。また、後方ポインタA6
は、このデータD2に対して後方に接続されるデータD
6のアドレス位置を示す。
The forward pointer A4 indicates the address position of the data D4 connected forward with respect to one data D2 forming the data chain. Also, the backward pointer A6
Is the data D connected to the rear of this data D2.
6 indicates the address position.

【0017】以下、A3〜A6番地の各データD3〜D
6についても、前方ポインタと後方ポインタとによっ
て、相互の接続関係が規定されている。
Hereinafter, each data D3 to D at addresses A3 to A6
Regarding 6 as well, the mutual connection relationship is defined by the front pointer and the rear pointer.

【0018】初期状態で、図2(a)に示すように、D1
→D2→D3→D4→D5→D6の順にデータチェーン
を構成しているとして、この状態から、一部のデータた
とえばD2とD5の接続順序を変更して、図2(b)に示
すように、D1→D5→D3→D4→D2→D6の順に
データチェーンを構成しようとした場合、次のようにし
て、データD1〜D6相互間の接続関係を変更する必要
がある。
In the initial state, as shown in FIG. 2 (a), D1
Assuming that the data chain is configured in the order of → D2 → D3 → D4 → D5 → D6, from this state, the connection order of some data, for example, D2 and D5, is changed, as shown in FIG. 2 (b). , D1 → D5 → D3 → D4 → D2 → D6 in order, it is necessary to change the connection relationship between the data D1 to D6 as follows.

【0019】まず、データD2については、その前後の
データD1,D3の接続関係を解消してから、新たにD
2の前後のデータD4,D6の接続関係を確立し、ま
た、データD5については、その前後のデータD4,D
6の接続関係を解消してから、新たにD6の前後のデー
タD1,D3の接続関係を確立する。
First, for the data D2, the connection relationship between the data D1 and D3 before and after the data D2 is canceled, and then a new D
2 establishes the connection relationship between the data D4 and D6 before and after 2, and the data D5 before and after the data D4 and D6.
After the connection relationship of 6 is canceled, the connection relationship of the data D1 and D3 before and after D6 is newly established.

【0020】したがって、データD1の後方ポインタA
2がA5に、データD2の前方ポインタA1がA4に、
後方ポインタA3がA6に、データD3の前方ポインタ
A2がA5に、データD4の後方ポインタA5がA2、
データD5の前方ポインタA4がA1に、後方ポインタ
A6がA3に、データD6の前方ポインタA5がA2に
それぞれ変更されて、最終的に同図(b)に示すようなメ
モリマップ図となる。
Therefore, the backward pointer A of the data D1
2 to A5, forward pointer A1 of data D2 to A4,
The backward pointer A3 is A6, the forward pointer A2 of the data D3 is A5, the backward pointer A5 of the data D4 is A2,
The front pointer A4 of the data D5 is changed to A1, the back pointer A6 is changed to A3, and the front pointer A5 of the data D6 is changed to A2, so that a memory map diagram as shown in FIG.

【0021】つまり、上記の例では、1回のデータ交換
(D2とD5の交換)でメモリ内の前方および後方の各ポ
インタを8箇所変更する必要がある。
That is, in the above example, one data exchange
It is necessary to change each of the front and rear pointers in the memory at 8 places by (exchange of D2 and D5).

【0022】[0022]

【発明が解決しようとする課題】このように、従来の方
法では、1回のデータ交換を行うためには、データの接
続先を示す前方および後方のポインタを8箇所変更する
必要があり、これは、データ交換の頻度によらず一定で
ある。
As described above, in the conventional method, in order to perform one data exchange, it is necessary to change the front and rear pointers indicating the connection destination of data at eight positions. Is constant regardless of the frequency of data exchange.

【0023】これを一般的に拡張して考えると、データ
数がN個あるとしたとき、従来方法では、最大で8N・
logN(回)のポインタの変更が発生する(たとえば、「イ
ンターフェイス」p187〜p189,Apr.1990参
照)。
When this is generally expanded and considered, assuming that the number of data is N, in the conventional method, the maximum is 8N.
A change of the pointer of log N (times) occurs (for example, see “Interface” p187 to p189, Apr. 1990).

【0024】したがって、従来の方法では、データの交
換回数が多くなれば、これに比例してポインタの変更頻
度も増大し、このため、データの交換回数が多い場合に
は、データのソート処理等の高速化を十分に図れないと
いう問題があった。
Therefore, in the conventional method, as the number of data exchanges increases, the frequency of pointer changes increases in proportion to the number of data exchanges. Therefore, when the number of data exchanges is large, data sorting processing or the like is performed. There was a problem that it could not sufficiently speed up.

【0025】本発明は、上述した課題を解決するために
なされたものであって、データの交換回数が多い場合で
も、データの接続先を示すポインタの変更回数が従来よ
りも少なくて済むようにして、データのソート処理等の
高速化が図れるようにすることを課題とする。
The present invention has been made in order to solve the above-mentioned problems. Even when the number of data exchanges is large, the number of changes of the pointer indicating the data connection destination can be made smaller than before. An object is to enable speeding up of data sort processing and the like.

【0026】[0026]

【課題を解決するための手段】本発明は、上述の課題を
解決するためになされたもので、次の構成を採る。
The present invention has been made to solve the above-mentioned problems, and has the following constitution.

【0027】すなわち、本発明に係るデータ交換方法で
は、各々のデータについて相互の接続関係を示す前方ポ
インタおよび後方ポインタが付加されて格納されたリス
ト構造のデータメモリ領域に対して、これとは別個にリ
ストメモリ領域を確保し、このリストメモリ領域に前記
データメモリ領域内の各データが格納されたアドレスを
示すアドレスポインタのみを予め格納しておき、データ
の接続順序を変更するに際しては、変更後のデータの接
続順序に対応させて、リストメモリ領域のアドレスポイ
ンタの順序を入れ換え、入れ換え後のアドレスポインタ
を参照して、データメモリ領域の前方ポインタおよび後
方ポインタの内容を変更するようにしている。
That is, in the data exchange method according to the present invention, the data memory area of the list structure in which the forward pointer and the backward pointer indicating the mutual connection relation of each data are added and stored is separated from this. A list memory area is secured in the list memory area, and only an address pointer indicating the address where each data in the data memory area is stored is previously stored in this list memory area. The order of the address pointers in the list memory area is switched according to the connection order of the data, and the contents of the forward pointer and the backward pointer in the data memory area are changed by referring to the changed address pointer.

【0028】[0028]

【作用】上記構成において、データ交換作業は、新たに
設けられたリストメモリ領域においてアドレスポインタ
の順序を入れ換えることにより行われ、この複数回のア
ドレスポインタの入れ換え作業が完了した時点で、その
結果が反映するように、データメモリ領域の前方ポイン
タおよび後方ポインタの内容を変更する。
In the above structure, the data exchanging work is performed by exchanging the order of the address pointers in the newly provided list memory area, and when the plural exchanging works of the address pointers are completed, the result is obtained. Change the contents of the forward and backward pointers in the data memory area to reflect the changes.

【0029】このように、従来では、1回のデータ交換
に対して、前方ポインタおよび後方ポインタの内容を連
鎖的に変更する必要があるため、ポインタ変更の回数が
多くなるのに対して、本発明では、新たに設けたリスト
メモリ領域においてアドレスポインタのみを先に変更す
るので変更箇所が少なく、このため、全体的に前方ポイ
ンタおよび後方ポインタの変更回数が削減されることに
なる。
As described above, in the conventional art, since the contents of the forward pointer and the backward pointer need to be changed in a chain for one data exchange, the number of times of changing the pointer increases, whereas According to the invention, since only the address pointer is changed first in the newly provided list memory area, the number of changes is small, and therefore, the number of times the front pointer and the rear pointer are changed is reduced as a whole.

【0030】[0030]

【実施例】図1は本発明のデータ交換方法を説明するた
めの一実施例を示すメモリマップ図である。
1 is a memory map diagram showing an embodiment for explaining a data exchange method of the present invention.

【0031】同図(a)は、データメモリ領域Kにおける
データ交換前の状態を示しており、これは図2(a)に示
した例と同じである。
FIG. 3A shows a state before data exchange in the data memory area K, which is the same as the example shown in FIG. 2A.

【0032】同図(b)は、リストメモリ領域Lにおける
データ交換前の状態を示している。
FIG. 3B shows a state in the list memory area L before data exchange.

【0033】同図(b)において、B+1〜B+7番地
は、リストメモリ領域Lのアドレスであり、A1〜A6
は、B+1〜B+7番地の各アドレスにそれぞれ格納さ
れているアドレスポインタであって、図1(a)に示すデ
ータメモリ領域K内の各データD1〜D6が格納された
A1〜A6番地の各アドレスを予め抽出して格納したも
のである。
In FIG. 3B, addresses B + 1 to B + 7 are addresses of the list memory area L, and A1 to A6.
Is an address pointer stored in each address of B + 1 to B + 7, and each address of A1 to A6 where each data D1 to D6 in the data memory area K shown in FIG. 1A is stored. Is extracted and stored in advance.

【0034】B+1〜B+7番地の各アドレスには、ポ
インタA1〜A6と一対になったフラグが格納される領
域が確保されている。フラグは、全て初期値の0にセッ
トされている。
An area for storing a flag paired with the pointers A1 to A6 is secured at each of the addresses B + 1 to B + 7. All flags are set to 0, which is an initial value.

【0035】図1(c)は、リストメモリ領域Lにおける
データ交換後の状態を示している。
FIG. 1C shows a state after data exchange in the list memory area L.

【0036】ここでは、リストメモリ領域LのB+2番
地とB+5番地のポインタの内容が変更されており、ま
た、この場合の、B+2番地とB+5番地のフラグのみ
1で、それ以外は0となっている。。
Here, the contents of the pointers at the addresses B + 2 and B + 5 in the list memory area L are changed, and in this case, only the flags at the addresses B + 2 and B + 5 are set to 1, and the other flags are set to 0. There is. .

【0037】同図(d)は、データメモリ領域Kにおける
データ交換後の状態を示しており、これは図2(b)に示
した例と同じである。
FIG. 3D shows the state after data exchange in the data memory area K, which is the same as the example shown in FIG. 2B.

【0038】次に、本発明に係るデータ交換方法につい
て説明する。
Next, the data exchange method according to the present invention will be described.

【0039】初期状態では、データメモリ領域Kの各デ
ータD1〜D6は、図1(a)に示すように、D1→D2
→D3→D4→D5→D6の順にデータチェーンを構成
しているとして、この状態から、一部のデータ、たとえ
ばD2とD5を交換して、図2(d)に示すように、D1
→D5→D3→D4→D2→D6の順にデータチェーン
を構成しようとした場合、次のようにして、データD1
〜D6相互間の接続関係を変更する。
In the initial state, each data D1 to D6 in the data memory area K is D1 → D2 as shown in FIG. 1 (a).
Assuming that the data chain is configured in the order of → D3 → D4 → D5 → D6, from this state, some data, for example, D2 and D5 are exchanged, and as shown in FIG.
When a data chain is to be constructed in the order of → D5 → D3 → D4 → D2 → D6, the data D1 is set as follows.
~ Change connection relationship between D6.

【0040】まず、図1(a)に示すデータメモリ領域K
内の各データD1〜D6が格納されたA1〜A6番地の
各アドレスを順に抽出して、図1(b)に示すように、リ
ストメモリ領域Lにこれらの各アドレスポインタA1〜
A6を格納する。
First, the data memory area K shown in FIG.
Each address of addresses A1 to A6 in which each data D1 to D6 in the data is stored is sequentially extracted, and each address pointer A1 to A1 is stored in the list memory area L as shown in FIG.
Store A6.

【0041】そして、このリストメモリ領域Lにおい
て、変更後のデータの接続順序に対応させてアドレスポ
インタの順序を入れ換える。すなわち、本例では、デー
タD2に対応するポインタA2と、データD5に対応す
るポインタA5とをそれぞれ交換する。
Then, in the list memory area L, the order of the address pointers is exchanged in correspondence with the changed data connection order. That is, in this example, the pointer A2 corresponding to the data D2 and the pointer A5 corresponding to the data D5 are exchanged.

【0042】さらに、交換したB+2番地とB+5番地
のフラグを1にセットする。
Further, the flags of the exchanged addresses B + 2 and B + 5 are set to 1.

【0043】その結果、リストメモリ領域Lのデータ内
容は、図1(c)に示すようになる。
As a result, the data content of the list memory area L becomes as shown in FIG.

【0044】次に、図1(c)の状態におけるリストメモ
リ領域Lのフラグを参照し、フラグが1の箇所を検索す
れば、B+2番地のアドレスポインタA5、B+5番地
のアドレスポインタA2が変更された値であることが判
別できる。
Next, referring to the flag of the list memory area L in the state of FIG. 1 (c) and searching for the location where the flag is 1, the address pointer A5 at the address B + 2 and the address pointer A2 at the address B + 5 are changed. It can be determined that the value is

【0045】そこで、図1(c)のリストメモリ領域Lに
おけるアドレスポインタA5に対応する、図1(a)のデ
ータメモリ領域KにおけるA5番地のアドレスの前方ポ
インタ(変更前はA4)および後方ポインタ(変更前はA
6)を、それぞれリストメモリ領域LのB+2番地(アド
レスポインタはA5)の前後にあるアドレスポインタA
1,A3の値に変更する。
Therefore, the forward pointer (A4 before change) and the backward pointer of the address A5 in the data memory area K in FIG. 1A corresponding to the address pointer A5 in the list memory area L in FIG. 1C. (Before change A
6) are the address pointers A before and after the address B + 2 (address pointer is A5) of the list memory area L, respectively.
Change to the value of 1, A3.

【0046】また、図1(c)のリストメモリ領域Lにお
けるアドレスポインタA2に対応する、図1(a)のデー
タメモリ領域KにおけるA2番地の前方ポインタ(変更
前はA1)および後方ポインタ(変更前はA3)を、それ
ぞれリストメモリ領域LのB+5番地(アドレスポイン
タはA2)の前後にあるアドレスポインタA4,A6の
値に変更する。
The forward pointer (A1 before change) and the backward pointer (change before) of the address A2 in the data memory area K of FIG. 1A corresponding to the address pointer A2 in the list memory area L of FIG. 1C. Previously, A3) is changed to the values of address pointers A4 and A6 before and after the address B + 5 (address pointer is A2) of the list memory area L, respectively.

【0047】さらに、リストメモリ領域LにおけるB+
2番地の直前のアドレスポインタA1に対応する、デー
タメモリ領域KにおけるA1番地の後方ポインタ(変更
前はA2)を、リストメモリ領域LのB+2番地のポイ
ンタA5の値に変更する。
Further, B + in the list memory area L
The backward pointer at address A1 in the data memory area K (A2 before change) corresponding to the address pointer A1 immediately before address 2 is changed to the value of the pointer A5 at address B + 2 in the list memory area L.

【0048】続いて、リストメモリ領域LにおけるB+
2番地の直後のアドレスポインタA3に対応する、デー
タメモリ領域KにおけるA3番地の前方ポインタ(変更
前はA2)を、リストメモリ領域LのB+2番地のポイ
ンタA5の値に変更する。
Subsequently, B + in the list memory area L
The forward pointer of the address A3 in the data memory area K (A2 before the change) corresponding to the address pointer A3 immediately after the address 2 is changed to the value of the pointer A5 of the address B + 2 of the list memory area L.

【0049】次に、リストメモリ領域LにおけるB+5
番地の直前のアドレスポインタA4に対応する、データ
メモリ領域KにおけるA4番地の後方ポインタ(変更前
はA5)を、リストメモリ領域LのB+5番地のポイン
タA2の値に変更する。
Next, B + 5 in the list memory area L
The backward pointer at address A4 in the data memory area K (A5 before change) corresponding to the address pointer A4 immediately before the address is changed to the value of the pointer A2 at address B + 5 in the list memory area L.

【0050】最後に、リストメモリ領域LにおけるB+
5番地の直後のアドレスポインタA6に対応する、デー
タメモリ領域KにおけるA6番地の前方ポインタ(変更
前はA5)を、リストメモリ領域のB+5番地のポイン
タA2の値に変更する。
Finally, B + in the list memory area L
The forward pointer of the address A6 in the data memory area K (A5 before the change) corresponding to the address pointer A6 immediately after the address 5 is changed to the value of the pointer A2 of the address B + 5 of the list memory area.

【0051】以上の結果、図1(a)のデータの接続関係
が、図1(d)のデータの接続関係に変更されて、データ
交換が完了する。
As a result, the data connection relationship of FIG. 1A is changed to the data connection relationship of FIG. 1D, and the data exchange is completed.

【0052】具体的にデータのソートを行なった場合の
データ変更回数を比較すると、いま、データ数がN個と
して、従来例では、前述のように、最大で8NlogN回
のデータ変更が発生する。
Comparing the number of data changes when the data is specifically sorted, it is assumed that the number of data is N, and in the conventional example, as described above, a maximum of 8NlogN data changes occur.

【0053】これに対して、本発明では、リストメモリ
領域Lにおけるアドレスポインタのデータ変更は、最大
で2NlogN(回)であり、また、最後の前方ポインタお
よび後方ポインタの変更は、最大で2N(回)であり、合
計2N+2NlogN(回)のデータ変更となる。
On the other hand, in the present invention, the data change of the address pointer in the list memory area L is 2NlogN (times) at the maximum, and the last change of the forward pointer and the backward pointer is 2N (max). Therefore, the total data change is 2N + 2NlogN (times).

【0054】したがって、Nが大きい程、従来例よりも
データ変更回数が大幅に削減できることになる。
Therefore, the larger N is, the more the number of data changes can be reduced more than the conventional example.

【0055】[0055]

【発明の効果】本発明によれば、データの交換作業を予
めアドレスポインタのみを格納したリストメモリ領域で
行うが、この場合、1回の交換の要する変更は2箇所の
みでよい。このリストメモリ領域におけるデータ変更回
数は、交換回数に比例するが、従来の4分の1である。
According to the present invention, the data exchanging work is performed in the list memory area in which only the address pointers are stored in advance, but in this case, one exchange requires only two changes. The number of data changes in this list memory area is proportional to the number of exchanges, but is one-fourth that of the prior art.

【0056】そして、リストメモリ領域において、アド
レスポインタの全ての入れ換え作業が完了した時点で前
方ポインタおよび後方ポインタの内容を変更するので、
従来例よりもデータ変更回数が大幅に削減できることに
なる。
Then, in the list memory area, the contents of the forward pointer and the backward pointer are changed when all the replacement work of the address pointers is completed,
The number of data changes can be significantly reduced as compared with the conventional example.

【0057】なお、データが複数回交換されずに1回の
みの場合は、新たに設けたリストメモリ領域での変更作
業が従来例に対してすべて増加分となってしまうが、同
データの交換回数が多くなればなるほど、従来例よりも
変更回数が削減できる。
If the data is exchanged only once instead of being exchanged a plurality of times, the change work in the newly provided list memory area will be increased by all compared with the conventional example. As the number of times increases, the number of changes can be reduced as compared with the conventional example.

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

【図1】本発明のデータ交換方法を説明するための一実
施例を示すメモリマップ図である。
FIG. 1 is a memory map diagram showing an embodiment for explaining a data exchange method of the present invention.

【図2】従来のデータ交換方法を説明するためのメモリ
マップ図である。
FIG. 2 is a memory map diagram for explaining a conventional data exchange method.

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

K…データメモリ領域、L…リストメモリ領域。 K ... Data memory area, L ... List memory area.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 メモリに格納された多数のデータの接続
順序を変更する方法であって、 各々のデータについて相互の接続関係を示す前方ポイン
タおよび後方ポインタが付加されて格納されたリスト構
造のデータメモリ領域に対して、これとは別個にリスト
メモリ領域を確保し、このリストメモリ領域に前記デー
タメモリ領域内の各データが格納されたアドレスを示す
アドレスポインタのみを予め格納しておき、データの接
続順序を変更するに際しては、変更後のデータの接続順
序に対応させて、リストメモリ領域のアドレスポインタ
の順序を入れ換え、入れ換え後のアドレスポインタを参
照して、データメモリ領域の前方ポインタおよび後方ポ
インタの内容を変更することを特徴とするデータ交換方
法。
1. A method for changing the connection order of a large number of data stored in a memory, the data having a list structure in which a forward pointer and a backward pointer indicating the mutual connection relationship of each data are added and stored. A list memory area is secured separately from the memory area, and only the address pointer indicating the address where each data in the data memory area is stored is previously stored in the list memory area, When changing the connection order, change the order of the address pointers in the list memory area according to the changed data connection order, refer to the changed address pointers, and refer to the forward and backward pointers in the data memory area. A method for exchanging data, characterized by changing the contents of.
JP7568194A 1994-04-14 1994-04-14 Data interchanging method Pending JPH07281871A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7568194A JPH07281871A (en) 1994-04-14 1994-04-14 Data interchanging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7568194A JPH07281871A (en) 1994-04-14 1994-04-14 Data interchanging method

Publications (1)

Publication Number Publication Date
JPH07281871A true JPH07281871A (en) 1995-10-27

Family

ID=13583191

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7568194A Pending JPH07281871A (en) 1994-04-14 1994-04-14 Data interchanging method

Country Status (1)

Country Link
JP (1) JPH07281871A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2008020634A1 (en) * 2006-08-17 2010-01-07 独立行政法人産業技術総合研究所 Data processing method and data processing apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2008020634A1 (en) * 2006-08-17 2010-01-07 独立行政法人産業技術総合研究所 Data processing method and data processing apparatus

Similar Documents

Publication Publication Date Title
EP1415248A1 (en) Method for fast searching and analyzing inter-relations between patents from a patent database
JPH07281871A (en) Data interchanging method
JP3034465B2 (en) Character input method using numeric keys
JP3092524B2 (en) Routing system
JPH0267639A (en) Queue control system with priority
US20110208782A1 (en) Method and computer program product for creating ordered data structure
CN117610906A (en) Method and device for creating and designing merging piece, terminal equipment and storage medium
JP3105842B2 (en) Ring buffer control method and processing device thereof
JP2752762B2 (en) Node matching processing method
JP3095980B2 (en) NC data creation method for electronic component mounting device
US20030212714A1 (en) Efficient deferred synchronization of objects
JPH0462630A (en) Character code converting device
JPH05250410A (en) Hierarchical symbol correcting system
JPS61150038A (en) Binary tree processing system
JPH01228022A (en) Tow-dimensional data storing system
JPH01309181A (en) Graphic data storing system for circuit diagram
JPH04288623A (en) Editing device
JPH01112431A (en) Method for constituting hierarchical knowledge system
JPH04137141A (en) Optimizing system for transcribe instruction
JPH08115435A (en) Drawing input information processing method in drawing input device
JPS59231659A (en) Memory controller
JPH02182056A (en) Message selection processing system
JPH06175862A (en) Electronic computer
JPH0146900B2 (en)
JPH0652329A (en) Linear plotting and polygonal painting-out device