【问题标题】:Generate array[0-k] for number of distinct sub-strings that are exactly 0 to k-repeated of a string using Suffix Array + LCP使用 Suffix Array + LCP 为字符串的 0 到 k 次重复的不同子字符串的数量生成数组 [0-k]
【发布时间】:2015-06-06 22:24:59
【问题描述】:

我在互联网上搜索:我发现了许多使用 Suffix 树但不使用 Suffix 数组的 k 重复子串的解决方案。

给定字符串:abaababb

最大重复子串数,k = 字符串长度 = 6

最初是 [0..k]={0}

子串的频率:“a”= 4 因此 a[4]=1;

子串的频率:“ab”= 3 因此 a[3]=1;

子串的频率:“b”= 4 因此 a[4]= a[4]+1 = 2; 等等..

复杂性:

使用后缀数组:

“abaabbabb”的后缀:

LCP  INDEX

0     2    aababb

1     0    abaababb

3     3    ababb

2     5    abb

0     7    b

1     1    baababb

2     4    babb

1     6    bb

【问题讨论】:

    标签: string suffix-array


    【解决方案1】:

    Codechef may15 long 问题。

    这篇社论对我有帮助:

    http://discuss.codechef.com/questions/69958/cbal-editorial

    【讨论】:

      猜你喜欢
      • 2021-07-24
      • 1970-01-01
      • 2019-07-24
      • 2020-10-02
      • 2016-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多