Suffix array DC3 algorithm -


i going on dc3 algorithm, linear time algorithm construction of suffix arrays. unable understand technique in paper can found here.

i unable understand how renaming, mentioned on page 6 of paper, done. how renaming done per step 1. relevant section of code appendix is:

for (int = 0; < n02; i++)  {      if (t[sa12[i]] != c0 || t[sa12[i]+1] != c1 || t[sa12[i]+2] != c2)      {            name++; c0 = t[sa12[i]]; c1 = t[sa12[i]+1]; c2 = t[sa12[i]+2];       }      if (sa12[i] % 3 == 1)       {            r[sa12[i]/3] = name;       } // write r1      else      {            r[sa12[i]/3 + n0] = name;       } // write r2  } 

please me understand portion. (this code page 20 of pdf)

after radix sort, adjacent element in sa12[] may equal, there if in loop, r1 , r2, give example:

original array [y b b d b b d o], n = 12, index range [0,11] r1 = [1,4,7,10] r2=[2,5,8,11], "if (sa12[i] % 3 == 1) " indicates sa12[i] belong r1, else belong r2, r concentration of r1 , r2.

hope helps.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -