CN1380606A - Method for implementing sequencing and search of hierarchical location by means of calculation - Google Patents

Method for implementing sequencing and search of hierarchical location by means of calculation Download PDF

Info

Publication number
CN1380606A
CN1380606A CN 01106995 CN01106995A CN1380606A CN 1380606 A CN1380606 A CN 1380606A CN 01106995 CN01106995 CN 01106995 CN 01106995 A CN01106995 A CN 01106995A CN 1380606 A CN1380606 A CN 1380606A
Authority
CN
China
Prior art keywords
rank
data
sequence
classification
sort
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
CN 01106995
Other languages
Chinese (zh)
Inventor
陈启星
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.)
CHEN QIXING CN
CHEN QIXING CN)
Original Assignee
CHEN QIXING CN
CHEN QIXING CN)
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 CHEN QIXING CN, CHEN QIXING CN) filed Critical CHEN QIXING CN
Priority to CN 01106995 priority Critical patent/CN1380606A/en
Publication of CN1380606A publication Critical patent/CN1380606A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The invention relates to a method of sorting order and search through computer to realize the classified location. The procedure of sorting order takes two steps: classified sorting order and completed sorting order. Based on the region of the numbers to be sortdd, m magnitude classes B (1)-B (m) are preset. With being calculated, the number taken out finds itself which classes B (1)-B (m) should belong to. When all n numbers to be sorted pass through the said calculation and all of them find the classes the numbers belong to, the first step i.e. the classified sorting order is completed. Then, the completed sorting order is carried out, which including the data collection and the sorting order within the class.

Description

By calculating ordering that realizes the classification location and the method for searching
A kind of computing machine sorts and one group of method that orderly data are searched for one group of unordered data.
Time complexity has quicksort, heapsort, Shell sorting, merge sort etc. preferably at present, and except that Shell sorting, other are several all to be the algorithm that sorts by " comparison ", according to stirling formula, [log is arranged 2(n! )]=O (nlogn), above-mentioned conclusion is told us from the order of magnitude, the golden hour complexity that the algorithm that sorts by " comparison " can reach under worst case is O (nlogn).Radix sorting is not the algorithm that sorts by " comparison ", and time complexity is O (d *N), wherein d is the figure place of key word from the most significant digit to the lowest order.In other words, all many times orderings more than.And first three kind is unstable ordering.
Is there there a kind of Utopian sort method? sort for complete unordered n number, Utopian method should be: every taking-up one number, can by calculate directly find its position that should come, after the n number is all calculated through one time, all find its position that should come, so just finished ordering.Obviously, can finish ordering as long as idealized ordering should be carried out an ordering, this is probably impossible.
One of purpose of the present invention is the stable sort method that will provide a kind of a time or minority time can finish, and makes for unordered data fully to sort, and its time complexity is reduced near O (n), promptly near Utopian ordering.Two of purpose provides a kind ofly searches by calculating, directly determines a very little seek scope to be beneficial to improve seek rate in the n number.Three of purpose is to transform traditional merge sort method, discards the recursive call method that the merge sort method is adopted, and only realizes merge sort with a single program, thereby improves ordering speed.
In principles illustrated of the present invention, for the purpose of unification, this explanation is a basic language with class pascal, and the regulation array index is the positive integer since 1, and the increase regulation can be used Dynamic Array or adjustable array.This method can be applied to other Languages fully, and array index is the situation of different regulations.Easy in order to narrate, will treat that sort key X (j) .Key is reduced to wait to sort number X (j).
The present invention is that search classification positioning sorting and classification location, and its ultimate principle is with ordering and searches the processing stage of all respectively being divided into classification and finish the stage.It is that wait the to sort distribution range of number or the distribution range of number to be searched are divided into a plurality of ranks that so-called classification is handled, represent these ranks with a array as rank variable, make other size of each grade corresponding the subscript value of a rank variable array element, when taking out a pending number (promptly wait to sort number or number to be found), obtain the corresponding relation of the subscript value of this pending number and above-mentioned array element with a transformation relation, make this pending number directly enter its pairing rank.Two stages of classification positioning sorting are:
One, the order of classification stage.According to waiting number X (the j) (j=1 that sorts ... n) the rank size at place is carried out order of classification, the maximum number of number of waiting to sort is Max, minimum number is Min, the distribution range of number is Max-Min so wait to sort, distribution range is preset as m big or small rank, the corresponding array element B (i) of each rank, B (i) is called rank variable, subscript i wherein is used to represent rank size (i=1 ... m), be called grade variable, each rank variable B (i) can both hold a plurality of numbers, whenever taking out a number to be sorted, corresponding its size can directly be scaled the size of B (i) subscript value i by calculating, find its rank B (i) that should belong to, just can directly put among the rank variable B (i) thereby need not search; After n number to be sorted is all calculated through one time, all directly find its rank variable B (i) that should belong to, just finished order of classification by the rank size.Being omnidistance unordered before order of classification, only is unordered in the level after order of classification, ordering between level and the level, and the ordering difficulty reduces.Each rank variable B (i) of order of classification must can deposit a plurality of data, so B (i) is comprising subordinate static array or Dynamic Array or pointing to a dynamic data structure.Such as, in order to save the auxiliary storage space, adopting the array stack architecture, each element B (i) of array B all is to point to a pointer to stack, so, when certain data is divided into rank variable B (i), just be pressed among B (i) storehouse pointed.Simultaneously, each rank all has a level inside counting device k (i) to add up data number in this rank, why will confuse in order that be unlikely to make a certain other counter of level and other other counter of level to be mixed up with the form of array variable k (i).
Two, complete phase sorting comprises data aggregation and two operations of level internal sort.When running into vacant level not during (not having key word in this rank) k (i)=0, next rank is handled in redirect; When running into the rank k (i)=1 of proper what a key word, key word is collected among the array D (t), next rank is handled in redirect again; When the rank k that runs into a plurality of key words (i)>1, carry out a grade internal sort earlier, again key word is collected among the array D (t), next rank is handled in redirect then.In the time of among data are collected into array D (t), suppose that data reference position (reference position or end position) in array D (t) among the rank B (i) are t, the needs for later classification is searched are saved in t among the array E (i).
Two stages that search the classification location are:
One, determines the seek scope stage.After providing a data X to be found, classic method is to search in number field whole process to be searched, it is on the order of classification basis that classification is searched, with X directly by conversion, become the size of E (i) subscript i, according to the t that deposits among the E (i), find the reference position t of X in array D (t), determine that according to k (i) it searches span again.
Two, search the stage location.In the scope definite, search, such as binary chop by t and k (i).
The operating process embodiment of classification positioning sorting makes an explanation in conjunction with the accompanying drawings.
Fig. 1 has represented to wait to sort the probability density curve f (x) of number X and the relation of order of classification.Horizontal ordinate is to wait to sort the sizes values of number X, ordinate is the probability density f (x) of X, in the probability density curve that Fig. 1 shows, the minimum value of data is MIN, maximal value is MAX, the data (1) of the perpendicular lattice correspondence on the curve, (2), (3), (i-1), (i), (i+1), (n-1), (n) not the size of horizontal ordinate X, but the size of the subscript value (i) of rank variable B (i), the X coordinate figure of their correspondences is respectively X1, X2, X3, Xi-1, Xi, Xi+1, Xn-1, Xn, we can pass through a conversion G with the X value of each minizone, are converted into the size of (i):
G (X)=(1), when X ∈ [X1, X2);
G (X)=(2), when X ∈ [X2, X3);
…;
G (X)=(i-1), when X ∈ [Xi-1, Xi);
G (X)=(i), when X ∈ [Xi, Xi+1);
…;
G (X)=(n-1), when X ∈ [Xn-1, Xn);
G (X)=(n) works as X=Xn.
Each X value is all corresponding to a subscript value (i), so each X value can be assigned among the corresponding array element B (i).
Fig. 2 is the order of classification synoptic diagram.1-number to be sorted.2-is by the rank variable (i=1..6) of array B (i) guiding, and each element B (i) of array B all has an arrow, and this is to point to a pointer to stack.Storehouse in the 3-level when certain data is divided into rank variable B (i), just is pressed among B (i) storehouse pointed.
Fig. 3 is the order of classification process flow diagram.The maximum subscript of 4-definition rank variable.X (N) is array to be sorted, and B (M) is the rank variable array pointer, D (N) be fully the ordering after array, more than three arrays all predict maximum subscript, can be defined as static array variable.5-will treat that sort key sends into an array variable X (j), prepare for calculating big or small rank B (i); If proceedings is for sending into variable X one by one, also can will treat that sort key sends into array variable.6-makes k (i)=0 (i=1..M), for counting is prepared with level inside counting device k (i) initialize; Simultaneously, obtain Max, Max2...MaxQ and Min, Min2...MinR, Max is a maximum number, and Max2 is the 2nd several greatly, and MaxQ is the big number of Q; Min is that minimum number, Min2 are the 2nd decimal, and MinR is the R decimal; Determine to wait the to sort distribution range of number, the word in this scope is considered as effective key word, is called for short key word; Be considered as invalid key at this extraneous word, be called for short and finish word.7-carries out classification to N key word one by one to be handled.8-evenly is divided into the scope of key word the classification operation expression of M grade, calculate the rank i of rank variable B (i), the classification function expression formula is i=1+trunc ((m-1) * (X (j)-MIN)/(MAX-MIN)), in fact exactly uniformly distributed function is rounded, can also be according to the distribution situation of N, M and Max, Max2...MaxQ, Min, Min2...MinR, select other distribution function to carry out the classification computing, as normal distyribution function, exponential distribution function, t distribution function, F distribution function, x 2Distribution function, Poisson distribution function; "+1 " that occurs in the expression formula, be since usually the array index minimum value in the PASCAL equal 1, if there is not this restriction, certainly not "+1 " this.9-B (i) ... expression array element B (i) storehouse pointed; After certain number X (j) is determined rank i, be pressed into a storehouse B (i) pointed by array element B (i) ..., as: [new (bbb); Bbb^.c1:=a[j]; Bbb^.link:=b[i]; B[i] :=bbb; ]; Simultaneously, order level inside counting device K (i)=K (i)+1 adds up in the i level storehouse and is pressed into the data number.
Fig. 4 is data aggregation and level internal sort program flow diagram.
M other data of level are carried out data aggregation to 10-and the level internal sort is handled to being divided into step by step.11-is when running into vacant level not during (not having key word in this rank) k (i)=0, and next rank is handled in redirect.12-is when running into the rank k (i)=1 of proper what a key word, with storehouse B (i) ... in number collect among the array D (t), and register the position t of this key word in array D (t) to array E (i), next rank is handled in redirect again.13-carries out a grade internal sort earlier when the rank k that runs into a plurality of key words (i)>1; If data volume is little in the level (k (i)<N1), it is fast to call bubble sort method speed; If data volume is big in the level, it is fast to call merge sort method speed; If data volume is very big in the level, can recursive call order of classification program.After the internal sort of 14-level, first position t that this rank is collected array D (t) registers to array E (i).The data aggregation of 15-after with the level internal sort is among array D (t), and next rank is handled in redirect again.
Fig. 5 is the program flow diagram that classification is searched.
16-carries out classification to data X to be found and calculates, and draws rank i value.If 17-is K (i)=0, representing does not have data in this rank, finishes to search.If the initial seek position t of X in array D (t) determined by the value of E (i) in 18-is K (i)>0, determine to search span by K (i).19-searches in t to t+K (i)-1 scope and has or not X to exist the array D (t), and this step searches and can call traditional any lookup method, such as calling binary chop.
From above classification positioning sorting method as can be known, the ordering time is made of three parts, and 1, the order of classification time; 2, the level internal sort time; 3, key word acquisition time.
The order of classification time is depended on the number n for the treatment of sort key and the computation complexity of classification function, and it is irrelevant with minute progression m, if will treat the number n of sort key and the computation complexity of classification function fixes, the order of classification time is promptly fixing, simultaneously as can be known, uniform classification function computation complexity is minimum, and the used time is minimum.
The level internal sort time, depend on: the sort method quality that (1) is adopted; (2) multiple key rank number; (3) multiple key number in the level.In other words, depend on branch progression m, m big more then (2) and (3) all can reduce, so the level internal sort time is short more.
The key word acquisition time is relevant with branch progression m, and the collection number of operations equals n and adds the other number of vacant level, is at least n, so m<n is irrational, should get the m value greater than n.When m>n, the other number of vacant level is not less than m-n, when m>>during n, the other number of vacant level is roughly m-n ≈ m.Divide the progression increase will cause that the sky number of levels increases, thereby cause that the key word acquisition time is elongated.
Take all factors into consideration three time factors, because it is much lower with respect to the complexity of order of classification and level internal sort when key word is collected to other complicated operation degree of vacant level, so an amount of increasing divided progression m, though can increase the other number of vacant level, can reduce multiple key number in multiple key rank number and the level significantly, reduce the level internal sort time, reduce T.T., so m is several times as much as n, be desirable such as selecting m=(2~5) * n.
Following examples are programming tool with PASCAL, and the order of classification program is provided.In order to save the space of a whole page, with " // " expression newline.
* order of classification program *
PROGRAM aspx (input, output); CONST //N=11; M=22; TYPE //count=1..M; //pt=^pt1; //pt1=record//c1:integer; //link:pt; //end; VAR //i, j, t:count; //a, d, e, k:ARRAY[count] OF integer; //b, bb:array[1..m] of pt; //bbb:pt; //min, max, q, r:integer; BEGIN//{ supposition has following number to be sorted } a[1] :=21; A[2] :=11; A[3] :=6; A[4] :=2; A[5] :=22; A[6] :=23; A[7] :=9; A[8] :=32; A[9] :=45; A[10] :=19; A[11] :=21; For t:=1 to M do k[t] :=0//max:=a[1]; Min:=a[1]; For t:=2 to n do//begin//if max<a[t] then max:=a[t] //else; if min>A[t] then min:=a[t] //end; { order of classification } m1:=m-1; //mm:=max-min; For j:=1 to n do//begin//i:=trunc (m1* (a[j]-min)/mm)+1; K[i] :=k[i]+1; //new (bbb); //bbb^.c1:=a[j]; Bbb^.link:=b[i]; //b[i] :=bbb; //end; { data aggregation and level internal sort } t:=1; //for i:=1 to m do//begin//if k[i]〉0 then//begin<!--SIPO<dP n="5">--<dp n="d5"/>If k[i]=1 then//begin//d[t] :=b[i] ^.c1; //e[i] :=t; //t:=t+1; //end elsebegin//e[i] :=t; //for r:=1 to k[i] do{ call level internal sort subroutine, as bubble sort or merge sort, collect d[t then] in end; //end; //end; { classification is searched, and waits to look into number and is X}i:=trunc (m1* (X-min)/mm)+1; //t:=e[i]; //for j:=t to t+k[i]-1 do{ calls the binary chop subroutine } //end.
The merge sort method is a kind of quick and stable sort method, but traditional merge sort method adopts the method for RECURSIVE CALL OF SUBPROGRAM still arithmetic speed to be had obstruction.In order to discard the RECURSIVE CALL OF SUBPROGRAM method in traditional merge sort method, a kind of formula merge sort method of walking is proposed.Consider that on the basis of order of classification the data of each grade can be not a lot, EMS memory occupation can be not a lot, so can adopt array to improve travelling speed; If data volume is bigger, also can adopt the array storehouse.Describe below in conjunction with accompanying drawing 6, accompanying drawing 7.
Fig. 6 is the block diagram that formula merge sort is on foot sorted for first time.
During the 20-merge sort, with the to be sorted number n of data number K (i) during in the level in the order of classification as merge sort.21-establishes to be had n and waits to sort number B (i) .C (h) (h=1..n) among the rank variable B (i) of rank i.First time ordering circulation of 22-, during first time ordering, the number of number B (i) .C (h) of waiting to sort is n, be considered as the n row, the adjacent column data are one group and sort in twos, that is: 1 row and 2 row, 3 row and 4 row ... (2*t-1) row and (2*t) row, or the like, with the ordering of 2*t row is the t row, and circulation t=1 to trunc (t/2) is for preceding even column is sorted.23-compares (2*t-1) row in twos with (2*t) column data, and sorting is t row p sequence, the t row of P (t) expression P sequence, k element in C (k) the expression sequence; As the end word, in the formula merge sort of walking, all sequences all to finish the word ending, judge according to finishing word whether this sequence finishes to each p sequence, promptly finish word by judgement and come Control Circulation, and need not consider a certain how many data elements of showing with MAX+1.If it is odd number that 24-is sorted sequence, last is listed as a p sequence.
Fig. 7 is the formula block diagram of walking of formula merge sort on foot.
25-is when being sorted the sequence number for greater than 1 the time, the formula of walking merge sort, and constantly carrying out the p sequence sorted in twos is the q sequence, again the q sequence being sorted in twos is the p sequence, and the p sequence is sorted in twos is the q sequence again ... loop computation, be a sequence until at last.26-will be sorted columns t assignment and give n; 27-carries out an ordering, and the preceding even column in the p sequence is sorted in twos is the q sequence, that is: 1 row and 2 row, 3 row and 4 row ... (2*t-1) row and (2*t) row, and with each q sequence with MAX+1 as finishing word; Algorithm when two sequences of 28-all have data; 29-is the size and the ordering of two row top data relatively; The t row of Q (t) expression Q sequence, the t row of P (t) expression P sequence; K element in C (k) the expression sequence.In the 30-31-two p sequences, only surplus one when showing data, and these remaining data are directly sent into the q sequence.Each q sequence of 32-finishes to finish word; If it is odd number that 33-is sorted the p sequence, directly change last p sequence into a q sequence.34-treats the collating sequence number n with last one time sequence number t as this time; 35-carries out next time ordering, and the q sequence is sorted in twos is the p sequence, and identical with 27 to 33 process, 27 to 34 orderings of carrying out are the p sequence to be sorted in twos be the q sequence, and 35 what carried out is the q sequence to be sorted in twos be the p sequence.Be turned back to 25 places after 35 again, circulation is carried out the p sequence sorted in twos and is the q sequence, and the q sequence is sorted in twos is the p sequence, is a sequence until at last.
Below be programming tool with FOXPRO, provide " the formula merge sort program of walking ", p (t, i) i element of t row in the expression P sequence; Q (t, j) j element of t row in the expression q sequence; X (i) is number to be sorted.
* * * *Formula merge sort on foot
input " please import and treat the collation element number " to N//dime X (N), and (N, N), (N, N) * is N/2 row or N/2+1 row with the merger in twos of N number to q to p.T=1//do while t<=int (N/2) //if X (2*t-1)<=X (2*t) //p (t, 1)=X (2*t-1) //p (t, 2)=X (2*t) //p (t, 3)=max+1//t=t+1//elsep (t, 1)=X (2*t) //p (t, 2)=X (2*t-1) //p (t, 3)=max+1//t=t+1ENDIF//enddo//if int (N/2)<N/2p (t, 1)=X (2*t-1) //p (t, 2)=max+1//t=t+1//endif//t=t-1 * walk formula merger do while t>1 when the row number greater than 1 the time, enter following merge program } * with the merger in twos of N row P sequence be N/2 row or N/2+1 row Q sequence * n=t//t=1//do while t<=int (N/2) //store 1 to i, j, kdo while p (2*t-1, i)<(max+1) .And.p (2*t, j)<(max+1) if p (2*t-1, i)<=p (2*t, j) //q (t, k)=p (2*t-1, i) //i=i+1//elseq (t, k)=p (2*t, j) //j=j+1//endif//k=k+1//enddodo while p (2*t-1, i)<max+1//q (t, k)=p (2*t-1, i) //k=k+1//i=i+1//enddodo while p (2*t, j)<max+1//q (t, k)=p (2*t, j) //k=k+1//j=j+1//enddoq (t, k)=max+1//t=t+1//enddo//t=t-1//store 1 to i, k//if int (N/2)<N/2//t=t+1//<!--SIPO<dP n="7">--<dp n="d7"/>Do while p (2*t-1; i)<max+1//q (t; k)=p (2*t-1; i) //k=k+1//i=i+1//enddoq (t; k)=max+1//endif * with the merger in twos of N row Q sequence be N/2 row or N/2+1 row P sequence * n=t//t=1//do while t<=int (n/2) //store 1 to i; j; kdo while q (2*t-1; i)<(max+1) .And.q (2*t; j)<(max+1) if q (2*t-1; i)<=q (2*t; j) //p (t; k)=q (2*t-1; i) //i=i+1//elsep (t; k)=q (2*t; j) //j=j+1//endif//k=k+1//enddodo while q (2*t-1; i)<max+1//p (t; k)=q (2*t-1; i) //k=k+1//i=i+1//enddodo while q (2*t; j)<max+1//p (t; k)=q (2*t; j) //k=k+1//j=j+1//enddop (t; k)=max+1//t=t+1//enddo//t=t-1//store 1 to i; k//if int (N/2)<N/2//t=t+1do while q (2*t-1, i)<max+1//p (t, k)=q (2*t-1; i) //k=k+1//i=i+1//enddop (t, k)=max+1//endif//enddo

Claims (10)

1, a kind of by calculating ordering that realizes the classification location and the method for searching, have multiple ordering at present and search feature of the present invention and be: will wait the to sort distribution range of number or the distribution range of number to be searched are divided into a plurality of ranks, represent these ranks with a array as rank variable, other size of each grade corresponding the subscript value of a rank variable array element, when taking out a pending number (promptly wait to sort number or number to be found), obtain the corresponding relation of the subscript value of this pending number and above-mentioned array element with a transformation relation, make this pending number directly enter its pairing rank.
2, the ordering of classification according to claim 1 location and the method for searching, its further feature is: ordering is divided into order of classification stage and complete phase sorting, so-called order of classification is, according to waiting number X (the j) (j=1 that sorts ... n) the rank size at place is carried out order of classification, the maximum number of number of waiting to sort is Max, minimum number is Min, the distribution range of number is Max-Min so wait to sort, distribution range is preset as m big or small rank, the corresponding array element B (i) of each rank, B (i) is called rank variable, subscript i wherein is used to represent rank size (i=1 ... m), be called grade variable, each rank variable B (i) can both hold a plurality of numbers, whenever taking out a number to be sorted, corresponding its size, can directly be scaled the size of B (i) subscript value i by transformation relation, find its rank B (i) that should belong to, just can directly put among the rank variable B (i) thereby need not search; After n number to be sorted is all calculated through one time, all directly find its rank variable B (i) that should belong to, just finished order of classification by the rank size.
3, the sort method of locating according to claim 1,2 described classifications, its further feature is: each rank variable B (i) of order of classification can both deposit a plurality of data, the structure of depositing a plurality of data among the rank variable B (i) can adopt the array stack architecture, also can adopt a static array or Dynamic Array in each grade classification variable B (i); When treating that the sorting data amount is big, the structure of depositing a plurality of data among the rank variable B (i) adopts the array stack architecture, each element B (i) of rank variable array B all is to point to a pointer to stack, so, when certain data is divided into rank variable B (i), just be pressed among B (i) storehouse pointed.
4, according to the sort method of claim 1,2 described classification location, its further feature is: each level other rank variable B (i) has a level inside counting device k (i) to add up data number in this rank.
5, the sort method of locating according to claim 1,2 described classifications, its further feature is: the classification transformation relation comprises various distribution function classifications, as uniformly distributed function, normal distyribution function, exponential distribution function, t distribution function, F distribution function, x 2Distribution function, Poisson distribution function.
6, the sort method of locating according to claim 1,2 described classifications, its further feature is: after order of classification, when among the rank variable B (i) two above data being arranged, need the data in this grade be sorted, data in certain grade can be used order of classification to this rank very for a long time; Data in certain grade not really for a long time can be with traditional sort method.
7, the ordering of classification according to claim 1 location and the method for searching, its further feature is: define data and collect array D (t), the array of having finished order of classification and grade internal sort is collected wherein; When data aggregation, judge at first in handled this rank whether data are zero, if be zero then next rank is handled in redirect immediately; Otherwise judge again whether data are 1 among handled this rank B (i), if be 1 with this data aggregation in data aggregation array D (t), simultaneously the position t of these data in D (t) is registered in array element E (i), next rank is handled in redirect then; If data are greater than 1 among handled this rank B (i), to carry out a grade internal sort earlier, and then the individual data of the k in this rank (i) are collected among the D (t), simultaneously, reference position t or ultimate position t in D (t) is registered in array element E (i) with these rank data, the reference position of array element E (i) expression i level data in D (t).
8, the ordering of classification according to claim 1 location and the method for searching, its further feature is: on the basis of classification positioning sorting, after providing a data X to be found, at first according to size of data to be found, directly be scaled the size of E (i) subscript value i by transformation relation, then according to the t that deposits among the E (i), find the reference position t of X in array D (t), determine that according to k (i) it searches span again, thereby determined data to be found among a small circle, used traditional method such as binary search at this among a small circle then.
9, the ordering of classification according to claim 1 location and the method for searching, when the level internal sort, if data volume is bigger in the level, can adopt traditional sort method, its further feature is: adopt the formula merge sort of walking, 1., first time ordering, the number of will waiting to sort sorts in twos and is the p sequence, and with each as a result sequence to finish the word ending; 2., per two P series arrangement are become a q sequence, and with each as a result sequence to finish the word ending; If the P sequence is an odd number, directly change last P sequence into the q sequence; 3., per two q series arrangement are become a p sequence, and with each as a result sequence to finish the word ending; If the q sequence is an odd number, directly change last q sequence into the P sequence; 4., as walking, 2.-3.-2.-3.-2.-3.-..., constantly carrying out the merger in twos of P sequence is the Q sequence, is the loop computation of P sequence with the merger in twos of Q sequence again, is a sequence until at last.
10, the ordering of classification according to claim 1 location and the method for searching, its further feature is: in the formula merge sort process of walking, all sequences are all to finish the word ending, during programming, by judging that finishing word comes Control Circulation, only judge according to finishing word whether this sequence finishes, and need not consider how many data elements this shows.
CN 01106995 2001-04-11 2001-04-11 Method for implementing sequencing and search of hierarchical location by means of calculation Pending CN1380606A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 01106995 CN1380606A (en) 2001-04-11 2001-04-11 Method for implementing sequencing and search of hierarchical location by means of calculation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 01106995 CN1380606A (en) 2001-04-11 2001-04-11 Method for implementing sequencing and search of hierarchical location by means of calculation

Publications (1)

Publication Number Publication Date
CN1380606A true CN1380606A (en) 2002-11-20

Family

ID=4655949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 01106995 Pending CN1380606A (en) 2001-04-11 2001-04-11 Method for implementing sequencing and search of hierarchical location by means of calculation

Country Status (1)

Country Link
CN (1) CN1380606A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105224590A (en) * 2015-07-07 2016-01-06 北京挺软科技有限公司 The instant discretize of a kind of data and the implementation method gathered
CN105574344A (en) * 2015-12-22 2016-05-11 常州信息职业技术学院 Pyramid sorting algorithm
CN105808654A (en) * 2016-02-29 2016-07-27 湖南蚁坊软件有限公司 Stream data-oriented two-level sorting method
CN106372166A (en) * 2016-08-31 2017-02-01 天津南大通用数据技术股份有限公司 Database system and inquiring method supporting to carry out rapid inquiry on data table
CN107291853A (en) * 2017-05-11 2017-10-24 四川省绵阳太古软件有限公司 A kind of quick determining device of air quality relevant information and method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105224590A (en) * 2015-07-07 2016-01-06 北京挺软科技有限公司 The instant discretize of a kind of data and the implementation method gathered
CN105574344A (en) * 2015-12-22 2016-05-11 常州信息职业技术学院 Pyramid sorting algorithm
CN105808654A (en) * 2016-02-29 2016-07-27 湖南蚁坊软件有限公司 Stream data-oriented two-level sorting method
CN106372166A (en) * 2016-08-31 2017-02-01 天津南大通用数据技术股份有限公司 Database system and inquiring method supporting to carry out rapid inquiry on data table
CN107291853A (en) * 2017-05-11 2017-10-24 四川省绵阳太古软件有限公司 A kind of quick determining device of air quality relevant information and method

Similar Documents

Publication Publication Date Title
US5440734A (en) System for MSD radix sort bin storage management
JPH0782428B2 (en) Partitioning method and device
Han et al. An efficient and fast parallel-connected component algorithm
Larsson et al. Faster suffix sorting
Bender et al. Cache-adaptive algorithms
CN87100829A (en) The method and apparatus that is used to retrieve
Pellegrini Scotch and PT-scotch graph partitioning software: an overview
Bader et al. Practical parallel algorithms for dynamic data redistribution, median finding, and selection
CN1380606A (en) Method for implementing sequencing and search of hierarchical location by means of calculation
CN101510215B (en) Data processing method and system in computer system
JPH0876975A (en) Sorting method and data processor
US20070156769A1 (en) Partition elimination system for a database that uses a multi-level partitioning definition
Salowe L-infinity interdistance selection by parametric search
Kale et al. Parallel sorting pattern
CA2427216A1 (en) Slow materialization sort of partially ordered inputs in a database system
Berkman et al. On parallel integer merging
CN109002467B (en) Database sorting method and system based on vectorization execution
CN107766472B (en) Contour hierarchical query parallel processing method based on multi-core processor
Ben-Amram et al. The subtree max gap problem with application to parallel string covering
CN1244049C (en) Speculative register adjustment
CN112965825A (en) Dynamic balance partitioning method and system for load balance
Kahale et al. Lower bounds for sorting networks
Reif et al. Dynamic parallel tree contraction
CN1096035C (en) Systems, methods and program products for representing binary word as two binary words having fewer binary ones
Gallivan et al. MCSPARSE: A parallel sparse unsymmetric linear system solver

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication