【问题标题】:question of skew suffix array algorithm presented in Simple Linear Work Suffix Array Construction简单线性功后缀数组构造中提出的倾斜后缀数组算法问题
【发布时间】:2021-02-05 11:03:56
【问题描述】:

最后附上论文“简单线性工作后缀数组构造”源码,这部分我看不懂,

// generate positions of mod 1 and mod 2 suffixes
// the "+(n0-n1)" adds a dummy mod 1 suffix if n%3 == 1
for (int i=0, j=0; i < n+(n0-n1); i++) if (i%3 != 0) s12[j++] = i;
// lsb radix sort the mod 1 and mod 2 triples
radixPass(s12 , SA12, s+2, n02, K);
radixPass(SA12, s12 , s+1, n02, K);
radixPass(s12 , SA12, s , n02, K);

第一个for循环用于获取mod 1和mod 2在数组中的索引;但是为什么输入索引的第一个radixPass应该是s+2+2 偏移量是如何得出的?

【问题讨论】:

    标签: algorithm suffix-array


    【解决方案1】:

    写完论文我就知道答案了,这三行用于mod 1和mod 2的索引从lsb到msb的基数排序。

    【讨论】:

      猜你喜欢
      • 2013-09-07
      • 2012-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-30
      • 1970-01-01
      • 2012-01-22
      • 1970-01-01
      相关资源
      最近更新 更多