Suffix Array - Example

Example

Consider the text to be indexed:

i 1 2 3 4 5 6 7
S b a n a n a $

The text ends with the special sentinel letter $ that is unique and lexicographically smaller than any other character. The text has the following suffixes:

Suffix i
banana$ 1
anana$ 2
nana$ 3
ana$ 4
na$ 5
a$ 6
$ 7

These suffixes can be sorted:

Suffix i
$ 7
a$ 6
ana$ 4
anana$ 2
banana$ 1
na$ 5
nana$ 3

The suffix array contains the starting positions of these sorted suffixes:

i 1 2 3 4 5 6 7
A 7 6 4 2 1 5 3

So for example, contains the value and therefore refers to the suffix starting at position within, which is the suffix .

Read more about this topic:  Suffix Array

Famous quotes containing the word example:

    Our intellect is not the most subtle, the most powerful, the most appropriate, instrument for revealing the truth. It is life that, little by little, example by example, permits us to see that what is most important to our heart, or to our mind, is learned not by reasoning but through other agencies. Then it is that the intellect, observing their superiority, abdicates its control to them upon reasoned grounds and agrees to become their collaborator and lackey.
    Marcel Proust (1871–1922)