Basic difference --- child burst suffix array yxs bare title board title monotonous simple application stack string study to understand problems

  First play persimmon, can be found open, the first part can be instantly determined, then the latter part just

  Then copy the board just fine, end Sahua !

  Below is a population Hu, as it has been abused burst muddle-headedness of

  Definitions: LCP (a, b) is the longest common prefix rank a, b two suffixes

  证明1:LCP(i,k)=min(LCP(i,j),LCP(j,k)),(i<=j<=k)

    sa [i] and sa [j] before the LCP (i, j) th character are equal, sa [j] and sa [k] pre LCP (j, k) characters are equal, LCP (i, k) is not It will be less than the right formula.

    Then (skyh:. Apparently) as suffix have been sorted, so there is the form $ \ left \ {\ the begin {Array} {CC} A & B & C & D \\ A & B & C & E \\ A & B & C & D & E \ End {Array} \ right $. Suffix, once in the middle of the LCP reduced, never restored again, so that LCP (i, k) is not greater than the right formula.

    So left-style equal to the right type.

  Proved 2: LCP (i, k) = min (LCP (j, j-1)), i <= j <= k

    By the prover 1, LCP (i, k) = min (LCP (i, i + 1), LCP (i + 1, k))

              = Min (LCP (i, i + 1), LCP (i + 1, i + 2), LCP (i + 2, k))

              ......    

    Thus the left and right formula of Formula equal.

  定义:height[i]=LCP(i,i-1),h[i]=height[rk[i]]

    Note that the left is the # i, i is the right location

  Demonstrate Hu mouth 3: [i]> = h h [i-1] -1

    We may assume rk [k-1] = rk [i-1] -1, then H [. 1-I] == the LCP (RK [-K. 1], RK [-I. 1]) .

     If the char [k-1]! = Char [i-1], then H [-I. 1] = 0, the formula clearly established

     If the char [k-1] == char [i-1], then the same time remove the char [k-1] and char [i-1], string [k-1] becomes string [k], string [i- 1] becomes string [i], obviously LCP (rk [i], rk [k]) == h [i-1] -1, and because rk [k-1] <rk [i-1], rk [k] <rk [i] , it should be written before a LCP (rk [k], rk [i]) == h [i-1] -1 a .

    由证明2,LCP(rk[k],rk[i])<=LCP(rk[i]-1,rk[i]),即LCP(rk[k],rk[i])<=h[i]

    Substitution equal amount, H [I]> = H [. 1-I] -1

    This theorem is seeking to ensure that the complexity of the array h.

 

  Seeking sa process:

    1. The original character as the first keyword into the bucket, no second keyword

    2. bucket sort, to obtain an initial sa

    3. Processing the first keyword position by the second sorting keyword position (starting position)

 

    4. The bucket sort, note that when the first sort key is the same key a second

    5. As a result of the first sort key next multiplication, attention is determined equal

    6. Analyzing the ranking number, if parallel, repeat 3-5

    7. No side by side, it has been calculated sa

  Seeking rank process:

    1. It is needless to ask you for a put sa become rank

  Seeking height process:

    1. First, remind yourself h is based on an array index (position) transfer, not rankings

    Enumerate position, initially 0

    The proof of 3, can be h [i-1] -1 is a starting point, and then expand the violence

    4. The end of a for loop, or determine height h

 

    Note that when rk [i] == 1, the proof of theorem 3 wilt permit only .. Patent determination which is equal to 0 (the proof has not found a use of k, said rk [k] <rk [ i]) (in fact i == 1 Shi Theorem is not established, as used in the i-1, but since the initial k is 0, it is the beginning of the violence ...)

    upd: I suddenly found the time to write the previous paragraph, the theorem requires a lot of conditions ... for example i> 1, k> 1, rk [i]> 1, rk [i-1]> 1 ... And I there is no way to control these theorems to solve all meet ... so when I see here in this plea oier who .. who can solve this problem ... Thank you ... (fog

   

Guess you like

Origin www.cnblogs.com/yxsplayxs/p/11291021.html