SA and rank descriptions of Suffix Arrays

Source: Internet
Author: User

Such as string: abcdef

 

Suffix not sorted:

1 adcefd

2 dcefd

3 cefd

4 EFD

5 FD

6 d

 

Save the suffix SA after sorting

1 adcefd

2 cefd

3 D

4 dcefd

5 EFD

6 FD

 

 

 

Rank array:

The subscript of the rank array corresponds to the subscript of the original string (the first letter of each suffix, the suffix of the original string)

The saved content corresponds to the subscript of the suffix string starting with the current subscript in the SA array (the row number in SA)

A D C E F D

1 2 3 4 5 6 // position of the first letter of each Suffix in the original string

Sa [5] = 4 // The EFD is saved in SA [5], and the initial suffix is E,

// The position of E in the original string a d c e f d is 4

Rank [4] = 5 // In the SA array, the first character of the suffix string is 4, that is, in the original string a D C E F D

// The suffix of the 4-character E string e f d is saved in the SA array at 5,

// Obviously SA [5] = E F D

 

Sort the suffix array SA:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.