I am reading suffix array construction tutorials from codechef and stackoverflow as well. One point I could understand is that they say..
It works by first sorting the 2-grams(*), then the 4-grams, then the 8-grams, and so forth, of the original string S, so in the i-th iteration, we sort the 2i-grams
And so forth. Each iteration i has two steps:
Sorting by 2i-grams, using the lexicographic names from the previous iteration to enable comparisons in 2 steps (i.e. O(1) time) each
Creating new lexicographic names
MY DOUBT IS: How can I use the index computed at 2-grams for 4 - grams. ?
Suppose my 2 suffixes are 'ab', 'ac' how can you compare then in O(1) time and give them indexes.
I really tried but stuck there. Please provide some example , that helps . Than ks in advance